I am trying to learn python language. For this I am using Python 3.3.2 Shell. The problem I am facing is this: When I type
var = input("Enter number here")
It asks me for an input but even if I give an integer value as an input it gives me error
TypeError: Can't convert 'int' object to str implicitly
I don't face this problem in python 2.7 shell. Can anyone tell why? Thanks in advance
input()is equivalent to Python 2'sraw_input(), which does not evaluate the input string for you. You have to do it yourself usingint()