這是我打的
age = input("Enter your age: ")
print("Next year you will be " + str(age +1))
終端機
Enter your age: 7
Traceback (most recent call last):
File "c:\Users\User\OneDrive\桌面\python\Exercise2-2", line 70, in
print("Next year you will be " + str(age +1))
TypeError: can only concatenate str (not "int") to str
請問為什麼無法印出Next year you will be 8.
求解!!!
這裡同時出現兩個問題