Python Forum

Full Version: raw_input vs input
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm having a hard time understanding the difference between raw_input and input. Can someone dumb it down for me?
Thank you,
Emily Senechal
Basically, raw_input = eval(input). The detail is that raw_input returns a string. However input tries to evaluate that string as a Python expression before returning the result.

That's how it works in Python 2.7 and earlier. In Python 3.0 and later, raw_input does not exist, and input works like raw_input in 2.7 (it just returns a string without trying to evaluate it.

If at all possible you should use Python 3.0 or later (current 3.7 I believe). End of life for Python 2.7 is in a little over a year.