【发布时间】:2020-10-15 21:46:42
【问题描述】:
我编写了这个简单的代码并尝试在 Windows 10 CMD 中执行......它收到了错误消息:
TypeError: Can only concatenate str (not "int") to str
代码:
userName = input('Name: ')
age = input('age: ')
factor = 2
finalAge = age + factor
print('In', factor, 'years you will be', finalAge, 'years old', userName+'!')
我在 Windows 10 中使用 Python 3.7.0
【问题讨论】:
标签: python