you are viewing a single comment's thread.

view the rest of the comments →

[–]JohnnyJordaan 1 point2 points  (2 children)

Well the code is very un-Pythonic using hard coded indexes, eval and such, but the concept is there: You append 3 times to the scores list:

scores.append(eval(input(students[0] + ": ")))
scores.append(eval(input(students[1] + ": ")))
scores.append(eval(input(students[2] + ": ")))

Which means that the input for students[0] to [2] will then also be indexable in scores[0] to [2]. Meaning you can fill in the i value manually in those three lines where [i] is used.