+ 1
[SOLVED]Need help with this code. Somebody help me if you can
Here is the code: z = 7 y = 4 a = 3 j = 12 x = input() if x == 7: print("Correct! you choose z!") else: print("No") Program outputs "no", even if i write 7. How to fix this?
2 Answers
+ 2
input() function accept input in the form of string..
So you need to convert to needed form by casting..
To cast to int do like this:
x = int( input() )
0
Thanks