Hello everyone I am stuck on my homework for python and I have searched the forum and have tried to figure it out for three hours now. I still can't find an answer or figure it out. It might be there but my lack of knowledge may have kept me from seeing it.
I'm using python version 3.2.3.
I cannot figure out how to display the results from the if statement in my print statement. So if the persons age is < 40 it says "you are young" and if the persons age is > 40 it prints "you look great". I easily have it print the first time but then I need it to print at the end where msg is located I cannot figure out how. I included all the code in case I am not explaining this right.
print("Hello", firstname, lastname, "you're", age, "years old", msg)
Thanks for the help in advance and again I apologize if the answer is already here somewhere
# ITP 100 Python Programming
# In Class Challenge September 10, 2012
# Getting users name and age as input
firstname = input("Hello. What is your first name? ")
lastname = input("What is your last name? ")
birthyear = input("What year where you born? ")
birthyear = int(birthyear)
age = 2012 - birthyear
print("\nYou're", age, "years old.")
if age < 40:
print("you are young.")
else:
print("You look great.")
print("Hello", firstname, lastname, "you're", age, "years old", msg)
input("\n\nPress n to exit")