December 30th, 2012, 05:23 PM
Input Function Error
I was using Python Shell and I was using the input function and it comes up with this error. Can someone tell me what went wrong, or perhaps if I am using the wrong version of python?
I currently use Python 3.3.0
The forum will not let me insert images so please replace the commas with periods in the url.
December 30th, 2012, 07:58 PM
Really would've been better to copypaste from the shell into your post...
Yes, the issue is version. In Python 3, unlike Python 2, the input() function does not automatically evaluate input. If you want an integer, you'll have to call int() or eval() on the input yourself.
Note that even in Python 2, use of the input() function is discouraged in favour of raw_input(), which behaves like the Python 3 input() function.