Standard input

https://docs.python.org/3/tutorial/inputoutput.html

https://docs.python.org/3/library/io.html

INTRODUCTION


# In Py2, there are two functions: raw_input() and input().
# raw_input([prompt]) - returns a string
# input([prompt]) - returns a value, equivalent to eval(raw_input(prompt))

reply = raw_input("Enter int:")
n = int(reply)   # exceptions possible

# In Py3, there is only input(), which works as raw_input() from Py2.

reply = input("Enter float:")   # a string without '\n'
x = float(reply)   # exceptions possible

# Compatibility.
try:
    input = raw_input
except NameError:   # we are in Py3
    pass

# Using sys.stdin (a file object, mode='r').

import sys
line = sys.stdin.readline()   # a string with '\n'