The if
statement with multiple conditions in one line below works properly:
exam1 = 70
exam2 = 60
exam3 = 50
if (100 >= exam1 and exam1 >= 60) or (100 >= exam2 and exam2 >= 60) or (100 >= exam3 and exam3 >= 60):
print("You passed!!")
Output:
You passed!!
But, the if
statement with multiple conditions in multiple lines below doesn't work properly:
exam1 = 70
exam2 = 60
exam3 = 50
if (100 >= exam1 and exam1 >= 60) or
(100 >= exam2 and exam2 >= 60) or
(100 >= exam3 and exam3 >= 60):
print("You passed!!")
Then, I got the error below:
File "main.py", line 5
if (100 >= exam1 and exam1 >= 60) or
^
SyntaxError: invalid syntax
So, how can I write the if
statement with multiple conditions and multiple lines?