I have the code below, I wish to run the while loop to remove a specific value from the list but not remove it on a certain index and still loop through the whole list without removing that specific occurrence.
a = 20
i = [5, 15, 20, 25, 50, 20, 80, 90, 20]
while a in i:
i.remove(a)
if a == i.index(5):
continue
print(i)
Maybe it's not supposed to be done with while loop but since learning the break or continue functions, i thought to give it a try. Thanks!