My problem is I have a list eg.
lst = [2, 5, 7, 12, 13]
lst.pop(3) #12
lst.pop(4) #13
Because lst[3] has been removed lst[4] is no longer there (out of range). This gives me an error. Now I know you could say change your code to this:...
lst.pop(4) #13
lst.pop(3) #12
...and it ill fix the error, but my problem is my actual code is 'popping' random numbers so it needs to be done all at the same time to avoid error.
Is there any method of 'popping' at the same time?...like something similar to this:
lst.pop(3, 4) #12 and 13 at once
Thanks for any answers.