0
Just need help in Python coding
What is wrong with my code? user_input = input(":") if user_input = 1 print("hello")
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")
+ 2
oh, you need to place your 'boolean expression' after if/elif
Example:
if expression:
# If it is true
Or elif expression:
0
thank you very much
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")
0
is it in the Boolean section of python course?