Fix Python – How do I use raw_input in Python 3?

Question

Asked By – Lonnie Price

In Python 2:

raw_input()

In Python 3, I get an error:

NameError: name ‘raw_input’ is not defined

Now we will see solution for issue: How do I use raw_input in Python 3?


Answer

Starting with Python 3, raw_input() was renamed to input().

From What’s New In Python 3.0, Builtins section second item.

This question is answered By – balpha

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