Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # coding=utf-8
- # Program obliczy średnią podanych ocen
- wydzial_ocen = ("1", "2", "3", "4", "5", "6")
- oceny = []
- ocena = raw_input("Podaj ocenę: ")
- while ocena != '':
- if ocena in wydzial_ocen:
- oceny += int(ocena),
- else:
- print "Ocena nie jest w wydziale ocen:\n",wydzial_ocen
- ocena = raw_input("Podaj kolejną ocenę: ")
- srednia = 0
- for ocena in oceny:
- srednia += ocena
- srednia = float(srednia)/len(oceny)
- print "Średnia tych ocen jest równa",srednia
Advertisement
Add Comment
Please, Sign In to add comment