Iterators for Dictionaries



Create your own Python dictionary, my_dict, in the editor to the right with two or three key/value pairs.

Then, print the result of calling the my_dict.items().

My code:

my_dict = {
  "Name": "Slark",
  "Skills": 4
  "Carry": True



File "python", line 4
    "Carry": True
SyntaxError: invalid syntax

That’s a lie. There’s no mistake.


I think there is a comma missing at the end of the previous line: “Skills”:4,


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.