Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import datetime
- today = datetime.date.today()
- year = today.year
- birth = input("What is your year of birth? ")
- age = int(year) - int(birth)
- print ('Your age is ', age)
- if age > 18:
- print('You are older that 18')
- elif age == 18:
- print('You are 18')
- else:
- print('You have less than 18')
Advertisement
Add Comment
Please, Sign In to add comment