1# To prompt the user to input an integer we do the following:
2valid = False
3
4while not valid: #loop until the user enters a valid int
5 try:
6 x = int(input('Enter an integer: '))
7 valid = True #if this point is reached, x is a valid int
8 except ValueError:
9 print('Please only input digits')
10
1#python program
2#taking int input from user
3#printing them
4
5#num1 from user
6num1 = int(input("Enter a number of type int"))
7print(num1)
8