Skip to content

Instantly share code, notes, and snippets.

@chookity-pokk
Created June 29, 2018 05:20
Show Gist options
  • Save chookity-pokk/27e9233049107923158a5bb0add37b7f to your computer and use it in GitHub Desktop.
Save chookity-pokk/27e9233049107923158a5bb0add37b7f to your computer and use it in GitHub Desktop.
A python program that tells you when you turn 100.
"""
Python program
Hank Greenburg
Purpose: 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.
date: 6/28/2018
"""
#To Do list:
#User input of age[*]
#User input of name[*]
#String saying "You'll turn 100 on the ####"[*]
age = input("What is your age?\n")
name = raw_input("What is your name?\n")
num = 100 - age
DoB = input("What year were you born?\n")
Year_Of_100 = age + num + DoB
print(name + ", you'll turn 100 on the year " + str(Year_Of_100))
#Above is my solution and below is the provided/better answer
name = raw_input("What is your name: ")
age = int(input("How old are you: "))
year = str((2018 - age)+100)
print(name + " will be 100 years old in the year " + year)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment