Skip to content

Instantly share code, notes, and snippets.

@jgarciabu
Created July 27, 2017 15:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jgarciabu/ba3191a88f42535ee05781c343fce786 to your computer and use it in GitHub Desktop.
Save jgarciabu/ba3191a88f42535ee05781c343fce786 to your computer and use it in GitHub Desktop.
"""
Practice Python 1st Exercise
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
age = input("Please enter your age:")
printmultiple = int(input("How many times should I print the info:"))
now = datetime.datetime.now()
yearstillhundred = 100 - int(age)
for i in range(printmultiple):
print("You will be 100 in the year {}\n".format((int(now.year) + yearstillhundred)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment