Created
October 4, 2017 21:00
-
-
Save goedel-gang/2a5624abced158b3485870e194fbbe8d to your computer and use it in GitHub Desktop.
Getting dancing scores in Python
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
couples = "abcde" | |
judges = range(1, 6) | |
scores = {} | |
for couple in couples: | |
scores[couple] = [] | |
for judge in judges: | |
sc = int(input("Judge {} enter score for couple {} > ".format(judge, couple))) | |
scores[couple].append(sc) | |
print("middle scores for couple {} are {}".format(couple, sorted(scores[couple])[1:-1])) | |
print("The total for couple {} is {}".format(couple, sum(sorted(scores[couple])[1:-1]))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment