0

Why My example Dictionary Code is something wrong?

Hey, I put the Code Dictionary into Code playground. Then, i test the code for study purpose. So i get the answer is wrong if i think that rights. My code just like this. nums = { 34:"Thirty Four" 45:"Fourty Five" 69:"Sixty Nine" } print(69 in nums) print(78 in nums) print(78 not in nums) but The output is SyntaxError because 45 in line 3. Anyone Can you tell me where is wrong part that happen and How I fix this please? https://code.sololearn.com/cB2tfkMwicbc/?ref=app

8th May 2017, 2:17 AM
Newbie
Newbie - avatar
2 Answers
+ 8
Put commas between the key:value pairs then it will work. 🙂
8th May 2017, 2:39 AM
David Ashton
David Ashton - avatar
0
David Ashton Oh god, I forgot the coma that thing. Thank you for help.
8th May 2017, 3:01 AM
Newbie
Newbie - avatar