Input output integer

To read input from the console, python has one single power full function input(), The input() function can be used to read any type of the data from the console, as It returns string data after reading from the console.

Output Integer

You can directly print an integer value to the console using the print() function without specifying its data-type.

See also: Python program to print to console

Method int()

The method int() used here to convert the input string to the number type.

Program

# Take input as a string from the user.
number = input("Enter any number : ")

# Convert it to integer
number = int(number)

# Print it
print("\nYour entered number :", number)

Output

Enter any number : 100
Your entered number : 100