+ 1

Why i am not getting an integer value?

a=input("enter a number. ") int(a) a=a*3 print(a)

22nd Oct 2019, 5:58 AM
PARITHOSH DESAI
PARITHOSH DESAI - avatar
2 Respostas
+ 3
Just replace int(a) With this a = int(a) Or alternatively you can directly cast the input to int as follows: a = int(input("Enter a number: ")) P.S. You should add 'Python' in Relevant Tags.
22nd Oct 2019, 6:40 AM
Ipang
+ 1
Thanks
22nd Oct 2019, 6:45 AM
PARITHOSH DESAI
PARITHOSH DESAI - avatar