Fix Python – What’s the difference between `raw_input()` and `input()` in Python 3?

Question

Asked By – pkumar

What is the difference between raw_input() and input() in Python 3?

Now we will see solution for issue: What’s the difference between `raw_input()` and `input()` in Python 3?


Answer

The difference is that raw_input() does not exist in Python 3.x, while input() does. Actually, the old raw_input() has been renamed to input(), and the old input() is gone, but can easily be simulated by using eval(input()). (Remember that eval() is evil. Try to use safer ways of parsing your input if possible.)

This question is answered By – Sven Marnach

This answer is collected from stackoverflow and reviewed by FixPython community admins, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0