+ 1
invalid syntax
letters=[‘a’, ’b’, ’z’] if (“2”) in letters: print (“YES”) Result: File "<string>", line 2 letters=[‘a’, ’b’, ’z’] ^ SyntaxError: invalid syntax
3 odpowiedzi
+ 9
You have a font problem. The code itself is working.
+ 6
You are using slanted quotation marks - possibly you pasted the code from a Word document? If you are coding outside a code editor, use plain text.
letters = ['a', 'b', 'z']
if "2" in letters:
print("YES 2")
if "a" in letters:
print("YES a")
0
same as mine,but the font is correct