Advertisement
estefani-adriano

Recruitment in the army! PYTHON

Oct 21st, 2023
1,235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.94 KB | Software | 0 0
  1. #recruitment in the army - PYTHON
  2.  
  3. from datetime import date
  4. print('-=-=' * 10)
  5. print('          RECRUITMENT IN THE ARMY!')
  6. print('-=-=' * 10)
  7.  
  8. birthYear = int(input('Date of birth? '))
  9. currentYear = date.today().year #ano atual
  10. calculateAge = (currentYear-birthYear)
  11. year2 = (18-calculateAge)
  12. year3 = (calculateAge-18)
  13. color = {'green' : '\033[4;32m', 'nothing' : '\033[m', 'red' : '\033[4;31m', 'yellow' : '\033[4;33m'}
  14.  
  15. if calculateAge < 18:
  16.     print('{}You are {} years old, {} year(s) away from enlistment!{}'.format(color['green'], calculateAge, year2, color['nothing']))
  17. elif calculateAge == 18:
  18.     print('{}You are {} years old, its time to enlist, please report to the battalion!{}'.format(color['yellow'],calculateAge, color['nothing']))
  19. elif calculateAge > 18:
  20.     print('{}You are {} years old, {} year(s) has passed since your enlistment period!{}'.format(color['red'], calculateAge, year3, color['nothing']))
  21.  
  22. #by Estéfani =D
Tags: python
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement