i have program in python asks user's name, 10 random maths questions, , @ end shows score out of 10.
i wondering if there way save scores file, @ end of program have first saves name , score , displays list of previous scores , users' names. (and made up, don't know commands):
save "leaderboard.txt":(name,":",score,"out of 10 [return key]") print (leaderboard.txt)
and after few goes output this:
dan: 7 out of 10↵ jack: 5 out of 10↵ benji: 10 out of 10↵
the return key symbol wouldn't there, want ready next score saved.
there way this?
also little added bonus, there way put multiple things in print command without them being separated spaces? can see in above code says dan:
, not dan :
happen if put print(name,":")
. there way of omitting space? thanks!
(using python 3.4.1 way)
Comments
Post a Comment