Advertisement
elizeub

Classificador de Atletas

Jul 24th, 2021 (edited)
1,210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.97 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. #
  4. #  Classificador de atleta.py
  5. #  
  6. #  Copyright 2021 Elizeu Barbosa Abreu <elizeubcorreios@gmail.com>
  7. #  
  8. #  This program is free software; you can redistribute it and/or modify
  9. #  it under the terms of the GNU General Public License as published by
  10. #  the Free Software Foundation; either version 2 of the License, or
  11. #  (at your option) any later version.
  12. #  
  13. #  This program is distributed in the hope that it will be useful,
  14. #  but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16. #  GNU General Public License for more details.
  17. #  
  18. #  You should have received a copy of the GNU General Public License
  19. #  along with this program; if not, write to the Free Software
  20. #  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  21. #  MA 02110-1301, USA.
  22. #  
  23. #  
  24.  
  25. import os
  26. from time import sleep
  27. from datetime import date
  28.  
  29. c = True
  30.  
  31. def cls():
  32.     os.system('clear')
  33.  
  34. def titulo():
  35.     cls()
  36.     print('{:^45}\n'.format('CLASSIFICADOR DE ATLETAS'))
  37.    
  38. def academia():
  39.     titulo()
  40.     nasc = int(input('Em que ano o atleta nasceu? '))
  41.     data_atual = date.today()
  42.     idade = data_atual.year - nasc
  43.    
  44.     if idade < 0:      
  45.         print('OPS! ESTE ATLETA AINDA NÃO NASCEU...') 
  46.     elif idade <= 9:
  47.         print('Idade: {} anos {:->20}'.format(idade, '> Atleta MIRIM'))
  48.     elif idade <= 14:
  49.         print('Idade: {} anos {:->20}'.format(idade, '> Atleta INFANTIL'))
  50.     elif idade <= 19:
  51.         print('Idade: {} anos {:->20}'.format(idade, '> Atleta JÚNIOR'))
  52.     elif idade <= 25:
  53.         print('Idade: {} anos {:->20}'.format(idade, '> Atleta SÊNIOR'))
  54.     elif idade <= 60:
  55.         print('Idade: {} anos {:->20}'.format(idade, '> Atleta MASTER'))
  56.     elif idade <= 100:
  57.         print('Idade: {} anos {:->20}'.format(idade, '> Atleta APOSENTADO'))
  58.     else:
  59.         print('Idade: {} anos {:->20}'.format(idade, '> TEM CERTEZA?'))
  60.                
  61.     print('\nDigite [Ctrl+C] para Sair ou AGUARDE...')
  62.     sleep(3)
  63.  
  64. while c:
  65.     academia()     
  66.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement