0
What's wrong with this code?
As a novice I've just scribbled something fairly basic in Python and it doesn't work https://code.sololearn.com/c3AaLYU4upc8/?ref=app
5 Respostas
+ 4
Markus,
thank you. so obvious!
Perhaps I should start learning Py on a desktop rather than on my mobile!
+ 2
remove = sign from the first print.
+ 2
looks like a little test 😉😉😉
0
By default input returns a string. You can convert it to an integer be doing
x = int(input("Blablabla"))
Or
if int(x) == 5:
0
Paul, thank you.
I've corrected the code as per your advise and it seems to work as there is no error message. however, after keying a number the code just goes blank. nothing happens. Could you have another glance at it please?
x = int (input ("What is X: "))
print=("Does X equal 5?")
if x == 5:
print("Yes")
else:
print("No")