python-programs/age_calc.py
2025-06-26 21:15:50 -04:00

20 lines
627 B
Python

while True:
try:
age = input("Enter your age: ")
if int(age) > 0 and int(age) < 13:
print("You're a kid!")
elif int(age) >= 13 and int(age) <= 19:
print("You're a teenager!")
elif int(age) >= 20 and int(age) <= 64:
print("You're an adult!")
elif int(age) >= 65 and int(age) <= 160:
print("You're a senior!")
elif int(age) > 160:
print("C'mon bruv, you should be ded by now.")
except ValueError:
print("Invalid input, please try again.")
except Exception as e:
print("Try again!")