nockywocky
Badges: 2
Rep:
?
#1
Report Thread starter 1 month ago
#1
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
noob1771
Badges: 4
Rep:
?
#2
Report 1 month ago
#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
0
reply
nockywocky
Badges: 2
Rep:
?
#3
Report Thread starter 1 month ago
#3
(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
that sounds like a really good idea i will try that thank you
0
reply
X

Quick Reply

Attached files
Write a reply...
Reply
new posts
Back
to top
Latest
My Feed

See more of what you like on
The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

Personalise

Do you have the space and resources you need to succeed in home learning?

Yes I have everything I need (249)
57.37%
I don't have everything I need (185)
42.63%

Watched Threads

View All