Created
June 22, 2020 14:07
-
-
Save abhi923/4bb5fb112d4c71755197ed7fd723d740 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment