Python Python Basics All Together Now Branch and Loop

Joaquim Maurício
Joaquim Maurício
1,148 Points

Problem with the IF statement syntax

Hello! First time posting here. The problem is in the following snippet: if option.lower() == "y": print("Thank you for your patronage!") tickets_remaining -= uammount

It is giving me the following syntaxerror: File "masterticket.py", line 22
if option.lower() == "y":
^
SyntaxError: invalid syntax

Any help is appreciated. Thanks!

2 Answers

Steven Parker
Steven Parker
174,057 Points

Often, when a syntax error is indicated at the very start of a line, the actual problem may be on the previous line.

I suspect that may be the case here, as there's nothing obviously wrong with the code shown. If you still don't spot it with this hint, please include the complete code, or at least more of the context near where the error occurred.

Joaquim Maurício
Joaquim Maurício
1,148 Points

Wow thanks for the lightning fast answer! I was missing a parenthesis in the line just before that one ahah

Glad to know I can count on the community :)