You're probably using Python 2.x, where input
will eval
the user input. Only in Python 3.x input()
returns the raw user input.
You can check the version of Python by running python
in console, e.g. this is Python 2.6:
~$ python
Python 2.6.5 (r265:79063, Apr 5 2010, 00:18:33)
[GCC 4.2.1 (Apple Inc. build 5659)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
You can run a specific version of Python (e.g. 3.1) by python3.1
:
~$ python3.1
Python 3.1.1 (r311:74480, Jan 25 2010, 15:23:53)
[GCC 4.2.1 (Apple Inc. build 5646) (dot 1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>