#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    1
    Rep Power
    0

    Input Function Error


    http://img545,imageshack,us/img545/2923/bdc75e2e03e8441ca126cbf,png

    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.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    114
    Rep Power
    4
    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.

IMN logo majestic logo threadwatch logo seochat tools logo