0
TypeError
Traceback (most recent call last): File "..\Playground\", line 7, in <module> year = str((2018 - age) + 100) TypeError: unsupported operand type(s) for -: 'int' and 'str' Code: name = input ("Please Enter your Name : ") print("Your Name is :" + name) age = input("Please Enter your Age :") print("Your Age is : " + age) year = str((2018 - age) + 100) print("The year you will be 100 years old is : " + year)
2 Respostas
+ 5
After you convert the variable age to int, you need to change the fourth line to print('Your age is: ' + str(age)) or print('Your age is:', age).
+ 4
Change the type of variable age to int like this:-
age = int(input("Please Enter your Age :"))