L = [2,4,5,8,9,10,3]
length = len(L)
for i in range(length):
if L[i] < 5 :
del L[i]
print(L)
리스트에서 5보다 작은값 추출하려 하는데 왜 오류가 나는지 모르겠습니다
Traceback (most recent call last):
File "C:/", line 45, in <module>
if L[i] < 5 :
IndexError: list index out of range