Explanation
There as been few changes between Python 2.x and Python 3.x .
One of them is the change of the input
function.
In Python 2, the input
function evaluate what the user is typing. This function is used when the user have to type a number. It will be parsed and the variable containing the return value of input
will be of type numeric (float
or int
).
https://docs.python.org/2/library/functions.html#input
In your case, since the name of the user is probably not a number, and if you are working with Python 2, you should use the function raw_input
which return the input of the user as a String without parsing. Meaning that if the user type a number, it is the String containing this number which will be returned.
https://docs.python.org/2/library/functions.html#raw_input
For security reasons, the input
function of Python 2 is not recommended to use because the function evaluate the input, and though it is very convenient for parsing numbers without cast, it allows also the user to inject malicious code into your application ;)
>>> print str(input("Enter your name: "))
Enter your name: __import__('os').listdir('.')
['super_secret.txt']
Thus, the input function has been replaced by the raw_input function in Python 3 and the raw_input function has been removed.
Fix
I think that the default behaviour of your os is to call python2
when you want to run python
. So, if you want to run python3
, you have to say it explicitly:
Your IDE seems to be correctly configured to use python3 as default interpreter.