scores = []
surfers = []
results_f = open("results.txt")
for each_line in results_f:
(name,score) = each_line.split()
scores.append(float(score))
for line in results_f:
(name,score) = line.split()
surfers.append(name)
results_f.close()
scores.sort(reverse = True)
print("The high scores are : ")
print("1 - "+str(scores[0]))
print("2 - "+str(scores[1]))
print("3 - "+str(scores[2]))
print(surfers[0])
Just an experimental program. But the second for loop doesn't seem to run. If I switch the positions of the for loops; again the loop in the second position wouldn't run. Why is this happening?