raw_input() and input() function in Python 2.x/3.x

raw_input() and input() function in Python 2.x/3.x

The raw_input() function is used in Python 2.x to read input data from keyboard.

The input() function is used in Python 3.x to read input data from keyboard.

Python 2.x raw_input example

data=raw_input('Enter text :')
print(data)

Python 3.x input example

data=input('Enter text :')
print(data)

Examples and usage: Python raw_input Example (Input From Keyboard)