lst =["赵敏","张大刚","张小忌","武则天","赢政","马超"]
for i in range(len(lst)):
print(i)
print(len(lst))
if lst[i].startswith("张"):
print(lst[i])
del lst[i]
print(lst)
print(lst)
报错
Traceback (most recent call last):
File "E:\python\test\test12.py", line 5, in <module>
if lst[i].startswith("张"):
~~~^^^
IndexError: list index out of range
请问下,是哪里的问题呢?