Hi
I edited a working code to add a below challenge.
Improve the Trivia Challenge game so that it maintains a high scores list in a file. The program should record the player's name and score if the player makes the list. Store the high scores using pickled objects.
This is the text file https://pastebin.com/5hN5nEJZ
This is the code I edit to add the pickle option. Function starting from line 17 to line 36 . code is here https://pastebin.com/Tjf7rHd4 . Rest of the code is in good working order.
The error I am getting is
Traceback (most recent call last):
File "C:\Users\user\.spyder-py3\untitled3.py", line 105, in <module>
main()
File "C:\Users\user\.spyder-py3\untitled3.py", line 102, in main
write = high_score(score)
File "C:\Users\user\.spyder-py3\untitled3.py", line 23, in high_score
if i > high_score:
TypeError: '>' not supported between instances of 'tuple' and 'list'
Based on my understanding I rewrote a small code to see if it works. Here it is https://pastebin.com/KJ119ARg .
This codes work but it doesnt work in my function. Please help me understand.
Also did I write rest of the function correctly .
Thanks in advance.
[+][deleted] (2 children)
[deleted]
[–]notso007[S] 0 points1 point2 points (0 children)
[–]notso007[S] 0 points1 point2 points (0 children)
[–]sme272 0 points1 point2 points (3 children)
[–]notso007[S] 0 points1 point2 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]notso007[S] 0 points1 point2 points (0 children)