1
ExpenseL是我的元組的名單,我嘗試從列表開始從開始消除對停止但我得到這個錯誤:在removeFromAtoB expenseL.pop(I) 類型錯誤:'元組'對象不能被解釋爲整數 請幫助我! :)列表元組的刪除錯誤
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)
非常感謝,現在的工作!!!! :) –