-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathex041.py
25 lines (22 loc) · 1.07 KB
/
ex041.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#RANKING-ATHLETES
#The National Swimming Confederation
#Needs a program that reads an athlete's year of birth and shows their category, according to age:
#Up to 9 years old: KINDERGARTEN
#Up to 14 years old: CHILDREN
#Up to 19 years old: JUNIOR
#Up to 25 years old: SENIOR
#Over 25 years old: MASTER
from datetime import date
birth = int(input("\033[034mWhat's your year of birth?\033[m "))
actualdate = date.today().year
age = actualdate - birth
if age <= 9:
print("You have \033[034m{}\033[m years, your category is \033[034mKINDERGARTEN\033[m.".format(age))
elif age > 9 and age <= 14:
print("You have \033[034m{}\033[m years, your category is \033[034mCHILDREN\033[m.".format(age))
elif age > 14 and age <= 19:
print("You have \033[034m{}\033[m years, your category is \033[034mJUNIOR\033[m.".format(age))
elif age > 19 and age <= 25:
print("You have \033[034m{}\033[m years, your category is \033[034mSENIOR\033[m.".format(age))
elif age > 25:
print("You have \033[034m{}\033[m years, your category is \033[034mMASTER\033[m".format(age))