Graitlion

Untitled

Jan 29th, 2023 (edited)
1,023
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.30 KB | None | 0 0
  1. import datetime
  2.  
  3. today = datetime.date.today()
  4. year = today.year
  5.  
  6. birth = input("What is your year of birth? ")
  7. age = int(year) - int(birth)
  8. print ('Your age is ', age)
  9. if  age > 18:
  10.     print('You are older that 18')
  11. elif age == 18:
  12.     print('You are 18')
  13. else:
  14.     print('You have less than 18')
Advertisement
Add Comment
Please, Sign In to add comment