Skip to content

Instantly share code, notes, and snippets.

@goedel-gang
Created October 4, 2017 21:00
Show Gist options
  • Save goedel-gang/2a5624abced158b3485870e194fbbe8d to your computer and use it in GitHub Desktop.
Save goedel-gang/2a5624abced158b3485870e194fbbe8d to your computer and use it in GitHub Desktop.
Getting dancing scores in Python
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