I am new to Python and I tried running the below code, which defines a list and iterates through it, removing the element at index "x".
list1 = [1, 2, 3, 4, 5, 6]
for x in list1:
list1.remove(x)
print(list1)
However it is removing elements at even indexes only, as you can see from the visual example below:
How can I modify my code to make it obtain the below output?
[2, 3, 4, 5, 6]
[3, 4, 5, 6]
[4, 5, 6]
[5, 6]
[6]
[]