Skip to content

Commit c28a626

Browse files
committed
Update ex041.py
1 parent 4de740b commit c28a626

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

ex041.py

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
#A Confederação Nacional de Natação precisa de um programa que leia o ano de nascimento de um atleta e mostre sua
2-
# categoria, de acordo com a idade: – Até 9 anos: MIRIM
3-
#– Até 14 anos: INFANTIL
4-
#– Até 19 anos: JÚNIOR
5-
#– Até 25 anos: SÊNIOR
6-
#– Acima de 25 anos: MASTER
1+
#The National Swimming Confederation needs a program that reads an athlete's birth year and shows their
2+
# category, according to age: – Up to 9 years old: child
3+
#– Up to 14 years old: children's
4+
#– Up to 19 years old: JUNIOR
5+
#– Up to 25 years old: SENIOR
6+
#– Over 25 years old: MASTER
77
from datetime import date
88
atual = date.today().year
9-
nasc = int(input('Qual o ano do nascimento do atleta?'))
10-
idade = atual - nasc
11-
print('O atleta nasceu em {} e tem {}anos.'.format(nasc, idade))
12-
if idade <= 9:
13-
print('Sua categoria é a MIRIM!')
14-
if idade >= 9 and idade < 14:
15-
print('Sua categoria é a INFANTIL!')
16-
if idade >= 14 and idade <= 19:
17-
print('Sua categoria é a JÚNIOR!')
18-
if idade >= 19 and idade <= 25:
19-
print('Sua categoria é a SÊNIOR!')
20-
elif idade >=25:
21-
print('Sua categoria é a MASTER!')
9+
birth = int(input('What year was the athlete born?'))
10+
age = atual - birth
11+
print(F'the athlete was born in {birth} and has {age} years old.')
12+
if age <= 9:
13+
print('Your category is CHILD!')
14+
if age >= 10 and age < 14:
15+
print("Your category is CHILDREN'S.")
16+
if age >= 15 and age <= 19:
17+
print('Your category is JUNIOR!')
18+
if age >= 20 and age <= 25:
19+
print('Your category is SENIOR!')
20+
elif age >=26:
21+
print('Your category is MASTER!')

0 commit comments

Comments
 (0)