Why doesn't my code work?

number = input("Phone: ")
dictionary = {
“1” : “One”
“2” : “Two”
“3” : “Three”
“4” : “Four”
“5” : “Five”
“6” : “Six”
“7” : “Seven”
“8” : “Eight”
“9” : “Nine”
}
print(dictionary.get(“9”))

I’m getting an error that says :

File “/Users/mylaptop/Desktop/python folder/numbertowordprogram.py”, line 4
“2” : “Two”
^
SyntaxError: invalid syntax

Please help me I’m new to python

Missing commas. You need one in between each dictionary item.

For example:

dictionary = {
“1” : “One”,
“2” : “Two”,
“3” : “Three”,
# ...
}

For future reference please see the pinned post on how to post code.

2 Likes

Thanks, this helped a lot!