Skip to content

Instantly share code, notes, and snippets.

@AtufaShireen
Created September 6, 2019 16:29
Show Gist options
  • Save AtufaShireen/3f877547be8a0762db3c17ba45138d58 to your computer and use it in GitHub Desktop.
Save AtufaShireen/3f877547be8a0762db3c17ba45138d58 to your computer and use it in GitHub Desktop.
from datetime import date
curr_date=date.today()
while True:
try:
age=int(input('How Old Are You?'))
except ValueError:
print('please enter your age')
else:
break
req_age=100-age
year_for_hundered_years=int(curr_date.strftime('%Y'))+req_age
print('You\'ll be 100 years old in ',year_for_hundered_years)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment