kubuntu 13.10
python 2.7
User Profile
Collapse
Profile Sidebar
Collapse
vadashbengals
Last Activity: May 8 '14, 10:26 AM
Joined: May 8 '14
Location:
-
how to limit top 5 high scores
...Code:import pickle scores = open("scores", "r") # READ the pickled data then add to it. hiscores = pickle.load(scores) scores.close() print hiscores # Use int() to get a number from raw_input() score=int(raw_input("Score?")) player=raw_input("Name?") hiscores.append((score, player)) print hiscores hiscores.sort()
No activity results to display
Show More
Leave a comment: