Thanks for the idea. Just some considerations:
- Del is a list with indices and not the items themselves, so if you replace the code with that line it won't output the same result.
-
del deletes all items with an equal value so if I have L=[2,2,2,1,2] and have Del=[2], I end up with L=[1], which useful, but not my goal here and the reason I went to pop() instead, so I can address indices. Same remark for
in.
- I wouldn't mind if
in and
del approach would work if you instead of checking the value would be checking if a list had such indices and then deleting all at the same time if so.
Again the same code with comments.
http://repl.it/f6E/3Thanks