Skip to content

Instantly share code, notes, and snippets.

@ehedaoo
Last active April 30, 2017 12:28
Show Gist options
  • Save ehedaoo/529ce6c1482a8e33893cca1b622e9d3a to your computer and use it in GitHub Desktop.
Save ehedaoo/529ce6c1482a8e33893cca1b622e9d3a 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 a message addressed to them that tells them the year that they will turn 100 years old.
# Create a program that asks the user to enter their name and their age. Print out a message addressed to them
# that tells them the year that they will turn 100 years old.
#
import datetime
name = input("Hello! Please enter your name: ")
print("Hello " + name)
age = int(input("Enter your age: "))
year_now = datetime.datetime.now()
#print(year_now.year)
print("You will turn 100 in " + str(int(100-age) + int(year_now.year)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment