Skip to content

Instantly share code, notes, and snippets.

@0x49D1
Created September 6, 2016 18:45
Show Gist options
  • Save 0x49D1/8117d8e390a6d8ba4b33cd4dc220ba31 to your computer and use it in GitHub Desktop.
Save 0x49D1/8117d8e390a6d8ba4b33cd4dc220ba31 to your computer and use it in GitHub Desktop.
Asks user for his birthyear and shows what year he hits 100
import datetime
# 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.
one_hundred_years = datetime.date.today().year - int(input("Enter your age:\n")) + 100
print_count = input("How many times do you want to print it?\n")
for i in range(int(print_count)):
print("%s You will hit 100 years on %s"%(i+1,one_hundred_years))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment