# To prompt the user to input an integer we do the following:
valid = False
while not valid: #loop until the user enters a valid int
try:
x = int(input('Enter an integer: '))
valid = True #if this point is reached, x is a valid int
except ValueError:
print('Please only input digits')
#python program
#taking int input from user
#printing them
#num1 from user
num1 = int(input("Enter a number of type int"))
print(num1)
num = int(input("inter your number: "))
print(num)
# Any input taken by python is always taken as a string.
# To convert it to an integer, we have to wrap input() in int(). Example:
num1 = int(input("Enter a number: "))
num2 = int(input("Enter another number: "))
total = num1 + num2
print(f'Sum: {total}')
birth_year = input("enter birth year: "); //input takes birth_year as STRING
age = 2022- int(birth_year); //birth_year is converted in INT
//other built in functions used for converting: int (), float (), bool(), str()
age = input("How old are you? ")
age = int(age)