Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- #
- # Classificador de atleta.py
- #
- # Copyright 2021 Elizeu Barbosa Abreu <elizeubcorreios@gmail.com>
- #
- # This program is free software; you can redistribute it and/or modify
- # it under the terms of the GNU General Public License as published by
- # the Free Software Foundation; either version 2 of the License, or
- # (at your option) any later version.
- #
- # This program is distributed in the hope that it will be useful,
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- # GNU General Public License for more details.
- #
- # You should have received a copy of the GNU General Public License
- # along with this program; if not, write to the Free Software
- # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- # MA 02110-1301, USA.
- #
- #
- import os
- from time import sleep
- from datetime import date
- c = True
- def cls():
- os.system('clear')
- def titulo():
- cls()
- print('{:^45}\n'.format('CLASSIFICADOR DE ATLETAS'))
- def academia():
- titulo()
- nasc = int(input('Em que ano o atleta nasceu? '))
- data_atual = date.today()
- idade = data_atual.year - nasc
- if idade < 0:
- print('OPS! ESTE ATLETA AINDA NÃO NASCEU...')
- elif idade <= 9:
- print('Idade: {} anos {:->20}'.format(idade, '> Atleta MIRIM'))
- elif idade <= 14:
- print('Idade: {} anos {:->20}'.format(idade, '> Atleta INFANTIL'))
- elif idade <= 19:
- print('Idade: {} anos {:->20}'.format(idade, '> Atleta JÚNIOR'))
- elif idade <= 25:
- print('Idade: {} anos {:->20}'.format(idade, '> Atleta SÊNIOR'))
- elif idade <= 60:
- print('Idade: {} anos {:->20}'.format(idade, '> Atleta MASTER'))
- elif idade <= 100:
- print('Idade: {} anos {:->20}'.format(idade, '> Atleta APOSENTADO'))
- else:
- print('Idade: {} anos {:->20}'.format(idade, '> TEM CERTEZA?'))
- print('\nDigite [Ctrl+C] para Sair ou AGUARDE...')
- sleep(3)
- while c:
- academia()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement