About 72 results
Open links in new tab
  1. What is the difference between list and list [:] in python?

    Nov 2, 2010 · When reading, list is a reference to the original list, and list[:] shallow-copies the list. When assigning, list (re)binds the name and list[:] slice-assigns, replacing what was previously in the list. …

  2. Python: list of lists - Stack Overflow

    The first, [:], is creating a slice (normally often used for getting just part of a list), which happens to contain the entire list, and thus is effectively a copy of the list. The second, list(), is using the actual …

  3. How do I make a flat list out of a list of lists? - Stack Overflow

    Editor's notes: 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 …

  4. Meaning of list[-1] in Python - Stack Overflow

    I have a piece of code here that is supposed to return the least common element in a list of elements, ordered by commonality: def getSingle(arr): from collections import Counter c = Counte...

  5. python - How to convert list to string - Stack Overflow

    Apr 11, 2011 · How can I convert a list to a string using Python?

  6. How to show a list of open files on the left in Notepad++

    In Notepad++, is there a way to show the list of files that are currently open in a list on the left instead of using the default tab-view? (I'd like it to resemble the way TextPad shows the file...

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

    The first way works for a list or a string; the second way only works for a list, because slice assignment isn't allowed for strings. Other than that I think the only difference is speed: it looks like it's a little …

  8. Power Automate – Some SharePoint List Columns Not Appearing in …

    Jun 14, 2025 · I'm working on a Power Automate flow that updates items in a SharePoint Online list. However, I'm facing an issue where certain columns (including Person/Group fields) are not …

  9. Difference between List, List<?>, List<T>, List<E>, and List<Object>

    The notation List<?> means "a list of something (but I'm not saying what)". Since the code in test works for any kind of object in the list, this works as a formal method parameter. Using a type parameter …

  10. python - if else in a list comprehension - Stack Overflow

    Feb 2, 2013 · can we have list comprehension without a for loop and just if/else to put a single default value inside the list and later extend it if required? i.e. result = [ 'hello' if x == 1 ].