Apr-26-2017, 07:55 PM
I'm trying to figure out how to get the program to calculate what year it is when the user is 100 years old.
The error that it gives me is: Traceback (most recent call last): TypeError: unsupported operand type(s) for -: 'int' and 'str'
The error that it gives me is: Traceback (most recent call last): TypeError: unsupported operand type(s) for -: 'int' and 'str'
[code] print("The date is as follows:") import datetime now = datetime.datetime.now() print (now.year, now.month, now.day) name = input("Hi. Please enter your name: ") print("Hello", name) age = input("Please enter your age: ") print("You are going to be age 100 on the year", (now.year-age+100))[/code]