Advertisement
Guest User

Untitled

a guest
Mar 20th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. from math import sqrt
  2.  
  3. dopoceny=[2,2.5,3,3.5,4,4.5,5]
  4.  
  5. print("Dopuszczone oceny: 2 , 2.5 , 3 , 3.5 , 4 , 4.5 , 5")
  6. print("Podaj pięć ocen: ")
  7.  
  8.  
  9. a = float(input("a: "))
  10. if a not in str(dopoceny):
  11. print("Ocena nie znajduje się na liście dopuszczonych ocen. Wpisz poprawną ocenę: ")
  12. a
  13. elif a in str(dopoceny):
  14. continue
  15. b = float(input("b: "))
  16. if b not in str(dopoceny):
  17. print("Ocena nie znajduje się na liście dopuszczonych ocen. Wpisz poprawną ocenę: ")
  18. b
  19. elif b in str(dopoceny):
  20. continue
  21. c = float(input("c: "))
  22. if c not in str(dopoceny):
  23. print("Ocena nie znajduje się na liście dopuszczonych ocen. Wpisz poprawną ocenę: ")
  24. c
  25. elif c in str(dopoceny):
  26. continue
  27. d = float(input("d: "))
  28. if d not in str(dopoceny):
  29. print("Ocena nie znajduje się na liście dopuszczonych ocen. Wpisz poprawną ocenę: ")
  30. d
  31. elif d in str(dopoceny):
  32. continue
  33. e = float(input("e: "))
  34. if e not in str(dopoceny):
  35. print("Ocena nie znajduje się na liście dopuszczonych ocen. Wpisz poprawną ocenę: ")
  36. e
  37. elif e in str(dopoceny):
  38. continue
  39.  
  40. Srednia = ((a+b+c+d+e)/5)
  41.  
  42. print(" Średnia pięciu ocen: ", srednia)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement