0

Just need help in Python coding

What is wrong with my code? user_input = input(":") if user_input = 1 print("hello")

20th Jan 2017, 8:06 AM
Blugon
Blugon - avatar
5 Respuestas
+ 4
First of all - indents. Pythob is whitespace sensetive Second - after IF you need : Third - to check equality use double = 4th - to check int and str convert it like int(input()) or == "1" Fix: user_input = int(input()) if user_input == 1: print("hello")
20th Jan 2017, 8:10 AM
WittyBit
WittyBit - avatar
+ 2
oh, you need to place your 'boolean expression' after if/elif Example: if expression: # If it is true Or elif expression:
20th Jan 2017, 8:55 AM
WittyBit
WittyBit - avatar
0
thank you very much
20th Jan 2017, 8:39 AM
Blugon
Blugon - avatar
0
I wanna ask you again...sorry now I can't make my code longer.... user_input = int(input()) if user_input == 1 print("Helo") elif: user_input == 2 print("Nono") else: print("input again")
20th Jan 2017, 8:53 AM
Blugon
Blugon - avatar
0
is it in the Boolean section of python course?
20th Jan 2017, 8:55 AM
Blugon
Blugon - avatar