About 18,500,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. Python pop() vs pop(0) - Stack Overflow

    Jun 11, 2014 · ubuntu-vm:~/sandbox$ ./test.py [0, 0, 0, 1, 2, 3] [0, 1, 2, 3, 4, 5, 6] Perhaps, I'm fundamentally misunderstanding how pop is implemented. But my understanding is ...

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

  4. 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, …

  5. 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:

  6. python - AttributeError: 'str' object has no attribute 'pop' - Stack ...

    May 27, 2017 · The exception is an AttributeError that states that 'str' object has no attribute 'pop'. So apparently, in the line words.pop(0), words is a string, not a list of strings, as the variable …

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

  8. python - Pop multiple items from the beginning and end of a list ...

    Jun 16, 2014 · Pop multiple items from the beginning and end of a list Asked 11 years, 5 months ago Modified 1 year ago Viewed 214k times

  9. python - How can I pop the list element from front? - Stack Overflow

    Sep 16, 2017 · The accepted answer (pop(0)) is the canonical way of doing this, but in the absence of that a simple alternative using readily available builtins is reversing the list such …

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