Syntax is apparently wrong | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 1

Syntax is apparently wrong

I am trying to run my code but it says the syntax is wrong. Its specifically highlights the colon at the end of the first if statement ('ID':) but I am pretty sure it is right. I am not sure how to fix it. #Nested if-statement for going inside a club item1 = input('Present first item please: ') item2 = int(input('Present second item please: ') if item1 == 'ID': if item2 == '10': print('You may enter') else: print('You may not enter without paying') else: print('You may not enter without paying or presenting identification')

2nd May 2020, 2:12 AM
Brian Gomez
Brian Gomez - avatar
2 Antworten
+ 4
Problem #1 item2 = int(input('Present second item please: ')) * Missing right side parentheses Problem #2 if item2 == '10': * <item2> is supposedly an int and you are testing it against a string. Do like this if item2 == 10:
2nd May 2020, 2:50 AM
Ipang
+ 2
Thank You. It worked
2nd May 2020, 3:29 PM
Brian Gomez
Brian Gomez - avatar