December 7th, 2012, 02:19 PM
I'm making a program that tells the user how old they are in years, minutes, seconds and how much longer they have left to live in minutes asuming they'll live to 85. But it comes as Error, can someone help me find it?
#This program will ask for the user's First and Last name as well as their age.
print ('Hello, what is your first name?')
print ('Hello ' + firstName + ', what is your last name?')
print ('How old are you?')
print(firstName + ' ' + lastName + ', welcome to the program. You are ' + ageYears + ' years old, and have lived for approximately ' + ageMinutes + ' minutes. You have approximately ' + ageLeft + ' minutes left in your life if you live to be 85. Enjoy the rest of your life, ' + firstName + ', as it will be over in approximately ' + ageSeconds + ' seconds.')
December 7th, 2012, 02:44 PM
You ran your program in python 3 and didn't bother to convert string returned from input() to an integer.
These statements produced some long strings! (Not integers as you expected.)
[/code] are essential for python code and Makefiles!
December 7th, 2012, 05:30 PM
Ohh, I see now, thanks for the help!