About 20,400,000 results
Open links in new tab
  1. Difference between del, remove, and pop on lists in Python

    Related post on similar lines for set data structure - Runtime difference between set.discard and set.remove methods in Python?

  2. pop function in Python - Stack Overflow

    The argument passed to pop function works as an index. So instead of popping the element with the value of 1, it pops the element at the index 1 which is the second element of the list.

  3. Python pop() vs pop(0) - Stack Overflow

    Jun 11, 2014 · Python pop () vs pop (0) Asked 11 years, 6 months ago Modified 4 years ago Viewed 59k times

  4. How can I remove a key from a Python dictionary?

    One case where dict.pop() may be useful is if you want to create a new dictionary with the popped key-value pairs, effectively splitting a dictionary into two in one for-loop.

  5. python - How do I remove the first item from a list? - Stack Overflow

    Dec 13, 2010 · This solution (which has been around since Python 3.0) should definitively be preferred if you need both, head and tail. Do you perhaps have some additional information at …

  6. In Python, what does dict.pop (a,b) mean? - Stack Overflow

    Mar 14, 2013 · The second question is covered in the Python Language Reference: If the form “*identifier” is present, it is initialized to a tuple receiving any excess positional parameters, …

  7. python - Equivalent for pop on strings - Stack Overflow

    Jun 15, 2012 · Equivalent for pop on strings Asked 13 years, 5 months ago Modified 6 years, 3 months ago Viewed 86k times

  8. Popping items from a list using a loop in Python [duplicate]

    Closed 2 years ago. I'm trying to write a for loop in python to pop out all the items in a list but two, so I tried this:

  9. pop/remove items out of a python tuple - Stack Overflow

    I have a tuple in python which I go through as follows (see code below). While going through it, I maintain a counter (let's call it 'n') and 'pop' items that meet a certain condition.

  10. What is the time complexity of popping elements from list in …

    Oct 12, 2008 · I wonder what the time complexity of the pop method of list objects is in Python (in CPython particulary). Also does the value of N for list.pop(N) affect the complexity?