« Python 2.7.3 (default, Mar 13 2014, 11:03:55)
>>> username = input("Username : ")
Username : guigui
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<string>", line 1, in <module>
NameError: name 'guigui' is not defined
>>> nb = input("Un nombre ? ")
Un nombre ? 42
>>> »
« In Python 2, raw_input() returns a string, and input() tries to run the input as a Python expression.
Since getting a string was almost always what you wanted, Python 3 does that with input(). As Sven says, if you ever want the old behaviour, eval(input()) works. [...] raw_input() does not exist in Python 3.x »
Wed Jul 15 13:00:19 2015 - permalink -
-
https://stackoverflow.com/questions/4915361/whats-the-difference-between-raw-input-and-input-in-python3-x