About 84,100 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 multiple items from the beginning and end of a list ...

    Jun 16, 2014 · Are you using a collections.deque() object here instead of a list? Because that makes a huge difference from using the plain list type! There is no list.popleft() method, in the …

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

    Jun 11, 2014 · 1 When you use the ' for item in ITEMS: ' command in python; you're still iterating by index, item is still implicitly set as item = ITEMS[index]. each pop (0) shifts the items to the …

  5. Using pop for removing element from 2D array - Stack Overflow

    Using pop for removing element from 2D array Asked 11 years, 1 month ago Modified 5 years, 6 months ago Viewed 51k times

  6. 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.

  7. python - Pop () not return any value when inside a function?

    Dec 6, 2020 · However, why does it not return the pop() value? Shouldn't it return 4 since the pop() function inside the solution() has a pop() function which, in definition, returns the value of …

  8. 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

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

    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:

  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?