Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- school_class = {}
- while True:
- name = input("Enter the student's name (or type exit to stop): ")
- if name == 'exit':
- break
- score = int(input("Enter the student's score (0-10): "))
- if name in school_class:
- school_class[name] += (score,)
- else:
- school_class[name] = (score,)
- for name in sorted(school_class.keys()):
- adding = 0
- counter = 0
- for score in school_class[name]:
- adding += score
- counter += 1
- print(name, ":", adding / counter)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement