fork download
  1. lst = [1,2,3,4,5,6]
  2.  
  3. for i in lst:
  4. print(lst,i)
  5. lst.remove(i)
  6. print(lst)
  7. print('-'*5)
Success #stdin #stdout 0.04s 9636KB
stdin
Standard input is empty
stdout
[1, 2, 3, 4, 5, 6] 1
[2, 3, 4, 5, 6]
-----
[2, 3, 4, 5, 6] 3
[2, 4, 5, 6]
-----
[2, 4, 5, 6] 5
[2, 4, 6]
-----