0

Python "if" problem....help me pleeease

print('Hello, World!') a=7 if a>6 print("right") SyntaxError at line 3 of your code: invalid syntax I don't know anything wrong , can anyone tell me whats wrong with my code, please

20th May 2022, 8:54 AM
Cham Sum Lau
3 Respostas
+ 3
There always needs to be a ":" at the end of if statements. ex: a = 3 if a == 3: print("yes") print("bye") # output yes bye
20th May 2022, 9:04 AM
Slick
Slick - avatar
0
Thank you very much ..i try many times
20th May 2022, 9:08 AM
Cham Sum Lau
0
There is a syntax error in your code in line 3 i.e the "if a>6". A double column(:) should follow right after that and if you would like to make it a little 'stuff stuff', you can add an else statement idented as the if block
22nd May 2022, 7:33 AM
OPAYOMI, Habeeb Oluwasegun
OPAYOMI, Habeeb Oluwasegun - avatar