a=['abc', '234', 'wdg', '220', '400', '395', '230', '350', ' ', '300', '300', '340', '420', '190', '300', '380', '270', 'wdg', '350', '380']
for i in range(len(a)):
if a[i]=="wdg":
a.pop(i)
print(a)
When I run these code, the error message shows" IndexError: list index out of range".(in line"if a[i]=="wdg":") What's wrong with it? I want to find all of the "wdg" in a list and delete it