Python Project: WhenYouTurn100.py

# the inspiration for this project comes from http://www.practicepython.org/exercise/2014/01/29/01-character-input.html
#Character Input project

#Goal is to create a program that asks the user to:
#enter their name and their age

from datetime import datetime

user_name = input("What is your name? ")
user_age = int(input("Enter your age: "))

#print out a message addressed to them that tells them the year that they will turn 100 years old

current_year = int(datetime.now().year)

turning_100 = (current_year - user_age + 100)

output = user_name +', you will turn 100 years old in the year ' + str(turning_100)
print(output)

# ask the user for another number

user_number = int(input('Please enter a whole number: '))
#print out that many copies of the previous message on separate lines

for i in range(user_number):
  print (output)
Advertisements