IO Methods

input() Method:
input() method allows user to give input.
SYNTAX:

input([prompt])

Parameter:
prompt - Optional. It is a string that display before the input.

Example:

var1 = input("Enter any thing: ")
print(var1)

Output:

Enter any thing: Hello
Hello

Read multiple values from the user in one line.
Example:

var1, var2, var3 = input("Enter three values: ").split()
print(var1)
print(var2)
print(var3)

Output:

Enter three values: 5 10 15
5
10
15

print() Method:
print() method is used to display object(s) on the screen.
SYNTAX:

print(*objects, sep=' ', end='\n', file=sys.stdout, flush=False)

Parameter:
*objects - Any object that will be displayed on the screen.
sep - Separator(optional). Which is used separate the objects. Default is space(' ').
end - Optional. Specifies what will printed at last. Default is new line('\n').
file - Optional. An object with a write method. Default is sys.stdout
flush - Optional. A Boolean, specifying if the output is flushed (True) or buffered (False). Default is False

Example1:

var1, var2, var3 = 5, 10, 15
print(var1,var2,var3)

Output1:

5 10 15

Example2:

var1, var2, var3 = 5, 10, 15
print(var1,var2,var3,sep='-',end='$')

Output2:

5-10-15$