SyntaxFix
Write A Post
Hire A Developer
Questions
pop is also useful to remove and keep an item from a list. Where del actually trashes the item.
pop
del
>>> x = [1, 2, 3, 4] >>> p = x.pop(1) >>> p 2