About 29,200,000 results
Open links in new tab
  1. How do I concatenate two lists in Python? - Stack Overflow

    405 How do I concatenate two lists in Python? As of 3.9, these are the most popular stdlib methods for concatenating two (or more) lists in Python. ... * A solution will qualify as a …

  2. slice - How slicing in Python works - Stack Overflow

    Python slicing is a computationally fast way to methodically access parts of your data. In my opinion, to be even an intermediate Python programmer, it's one aspect of the language that it …

  3. python - Find a value in a list - Stack Overflow

    In Python 3, filter doesn't return a list, but a generator-like object. Finding the first occurrence If you only want the first thing that matches a condition (but you don't know what it is yet), it's …

  4. list - In Python, what is the difference between ".append ()" and ...

    In general, if you're appending/extended an existing list, and you want to keep the reference to the same list (instead of making a new one), it's best to be explicit and stick with the append …

  5. python - How do I make a flat list out of a list of lists? - Stack …

    If your list of lists comes from a nested list comprehension, the problem can be solved more simply/directly by fixing the comprehension; please see How can I get a flat result from a list …

  6. Python: list of lists - Stack Overflow

    First, I strongly recommend that you rename your variable list to something else. list is the name of the built-in list constructor, and you're hiding its normal function. I will rename list to a in the …

  7. python - How do I clone a list so that it doesn't change …

    4150 new_list = my_list doesn't actually create a second list. The assignment just copies the reference to the list, not the actual list, so both new_list and my_list refer to the same list after …

  8. python - How to remove all duplicate items from a list - Stack …

    How would I use python to check a list and delete all duplicates? I don't want to have to specify what the duplicate item is - I want the code to figure out if there are any and remove them if so, …

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

    Dec 13, 2010 · In fact, the first sentence is misleading, because you cannot remove the i'th element with list.remove(a[i]). With duplicate values, it may find an earlier element with the …

  10. python - Pythonic way to find maximum value and its index in a …

    This converts my_list to a list of tuples (v,i) where v is every item of my list and i is the correspondent index, then it gets the tuple with the maximun value and with its associated …