Skip to content

Instantly share code, notes, and snippets.

@ghughes13
Created June 5, 2016 17:31
Show Gist options
  • Save ghughes13/c8aa5764ea5074fe9ed433e03126793d to your computer and use it in GitHub Desktop.
Save ghughes13/c8aa5764ea5074fe9ed433e03126793d to your computer and use it in GitHub Desktop.
Calculates Years Until You Turn 100
name = str(input("What's your name? "))
age = int(input("What's your age? "))
years = 100 - age
printNum = int(input("How many times do you want to print it? "))
def timesPrint(printNum):
while printNum > 0:
print ("I see that you're " + str(age) + ". That means you'll be 100 in " + str(years) + " years!")
printNum -= 1
timesPrint(printNum)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment