Scripting >> Python >> Examples >> Input Output >> How to read input data from the terminal

 

Version Example 1:
Python 2.6 >>> name=raw_input("What is your name: ")
What is your name: John
>>> print(name)
John
Python 2.7
Python 3.6 >>> name=input("What is your name: ")
What is your name: John
>>> print(name)
John

Python 2.x uses raw_input()

Python 3.x uses input()