2020 NEA project OCR
Watch
Announcements
Page 1 of 1
Skip to page:
For my project, I have to display a score and the player name of the top 5 winning scores from the external file has to be print. However, I am very confused about how to do this. Any ideas?
0
reply
Report
#2
For python:
something that you could try is read the file line by line into the game in a list and then using the "sorted" function you can sort that list in order of hight to lowest scores and then a simple for loop to print the first 5 names and scores
something that you could try is read the file line by line into the game in a list and then using the "sorted" function you can sort that list in order of hight to lowest scores and then a simple for loop to print the first 5 names and scores
0
reply
(Original post by noob1771)
For python:
something that you could try is read the file line by line into the game in a list and then using the "sorted" function you can sort that list in order of hight to lowest scores and then a simple for loop to print the first 5 names and scores
For python:
something that you could try is read the file line by line into the game in a list and then using the "sorted" function you can sort that list in order of hight to lowest scores and then a simple for loop to print the first 5 names and scores

0
reply
X
Page 1 of 1
Skip to page:
Quick Reply
Back
to top
to top