age check python
# Imports
import datetime
import time
while True:
# Variables & Big Catching
age = input('What year where you born? ')
current_time = datetime.datetime.now().year
if age.isdigit() is False:
print('Please enter a number')
quit()
elif len(age) != 4:
print('Please enter a valid year!')
quit()
elif age.isdigit() and len(age) == 4:
int_age = int(age)
if int_age < 1900:
print('Please enter a valid year!')
quit()
elif int_age > current_time:
print('Please enter a valid year!')
quit()
final_age = current_time - int_age
print('You are', final_age, 'or', final_age - 1, 'years old')
time.sleep(1)