(Sep-08-2021, 07:29 PM)muzikman Wrote: Greetings,
I am trying to loop through a list of move titles and their corresponding rating. ex.
Title = 'Rocky', Rating = 5
How can I continue to add more titles and associative rating to the dictionary without overwriting?
mydict = {'Rocky': 5, 'Rocky II': 4,...}Something like that? or how would I do it with title and rating keys? Nested?
I am looking for something similar to a lists append method.
I want to be able to iterate over this dictionary when it's full.
Thanks in advance
Matt
I was thinking, I could also do something like this, make a list of tuples or a tuple of tuples.
mylist=[('Rocky',5), ('Rocky II', 4)] mylist.append(('Scary Movie', 2)) for x,y in mylist: print(x,y)