0
Why does an input of 5 give 0No
2 Answers
+ 3
Hi, Goodness Ogunlana!
Because what you gives as argument to the input function ( x = input(int()) ) become a promt for input.
And you gave int() as a argument to the input function, which return 0.
This is a bit tricky to see in SoloLearns app, when you make your inputs in a box.
So input promts first 0, and then you inputed 5. But 5 is not converted to an integer; itâs still a string, so your if statements condition (if x == 5:) becomes False and it prints âNoâ. So it becoms:
0No
+ 2
x = int(input())