Skip to content

Instantly share code, notes, and snippets.

@Tig10
Created June 4, 2020 13:45
Show Gist options
  • Save Tig10/2d5d5a0788ebdf57bd29aecdc5d75919 to your computer and use it in GitHub Desktop.
Save Tig10/2d5d5a0788ebdf57bd29aecdc5d75919 to your computer and use it in GitHub Desktop.
'''
Create a program that asks the user to enter their name and their age.
Print out the message addressed to them that tells them the year they
will turn 100 years old.
'''
from datetime import datetime
today = datetime.now()
name = input('What is your name? ')
age = int(input('What is your age? '))
years_to_100 = 100 - age
year_of_100 = today.year + years_to_100
print(f'{name} you will be a 100 years old in the year {year_of_100}.')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment