I'm relatively new to Python (but not with programming) and I'm getting quite confused with how dictionaries work in Python. I have a program that saves the score of a current player. Whenever the game ends, I need to save the score in a dictionary with keywords 'username', 'runtime', and 'errors'. So my final output would be something like:
Score - Username - RunTime - Error
10-------Jane--------7s--------3--
15-------Brian-------7s--------3--
12-------Dave--------7s--------3--
09-------Aura--------7s--------3--
In the terminal, I should display the output of the dictionary which I think should be:
{ '10' : ['username': Jane, 'runtime': 7s, 'errors':3], '15' : ['username': Brian, 'runtime': 7s, 'errors':3], and so on and so forth
Is this possible? What should be the workaround here? Thank you for the help
[{'username': 'Jane', 'runtime': '7s', 'score': 10}, {'username': 'Brian', 'runtime': '7s', 'score': 15}])