【发布时间】:2016-11-09 17:15:52
【问题描述】:
ExpenseL 是我的元组列表,我尝试从 start 到 stop 的列表中删除,但我只是收到此错误:in removeFromAtoB 费用L.pop(i) TypeError: 'tuple' 对象不能被解释为整数 请帮我!!! :)
def removeFromAtoB():
aux = copy.deepcopy(expenseL)
print(expenseL, "\n")
start = int(input("Starting point: "))
stop = int(input("Ending point: "))
j = 0
for i in expenseL:
if j >= start and j <= stop:
expenseL.pop(i)
j += 1
print(expenseL)
【问题讨论】:
标签: list python-3.x tuples