+ 1
I have to use 'x' variable as user input
x = input ("enter the number: ") if x == 5: print("Yes") else: print("No") is this program is write.
11 RĂ©ponses
+ 3
I got what u need(found on google)....its int() use it to convert input into an integer.
x = int(input("inputs here"))
and use float() if u want to convert it into a float
+ 2
try this simpler example:
x = 4
if x == 5:
print("Yes")
else:
print("No")
with this you should get output.
+ 2
I tried your code as you've posted it and it works perfectly on my phone. đ€
+ 1
Correct logic, idk about the syntax though.
Which language will you write this in?
If it's python I think it's correct.
+ 1
I think it is because input takes the user inputs as a string but u are comparing it with a number so its never equal....maybe firsy try converting that input into a number.....idk about python so cant help in that
0
It is correct.
0
but it's not working
0
it's python only ..
I am not getting output
0
thans bro that will works I know but I need X variable as a user input
0
thans bro it's working
0
is it java language.