【发布时间】:2013-12-24 19:34:46
【问题描述】:
我目前正在学习 Python,所以我不知道发生了什么。
num1 = int(input("What is your first number? "))
num2 = int(input("What is your second number? "))
num3 = int(input("What is your third number? "))
numlist = [num1, num2, num3]
print(numlist)
print("Now I will remove the 3rd number")
print(numlist.pop(2) + " has been removed")
print("The list now looks like " + str(numlist))
当我运行程序时,输入 num1、num2 和 num3 的数字,它会返回: Traceback(最近一次调用最后一次):
TypeError: unsupported operand type(s) for +: 'int' and 'str'
【问题讨论】:
标签: python python-3.x list int