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

    Python >= 3.5 alternative: [*l1, *l2] Another alternative has been introduced via the acceptance of PEP 448 which deserves mentioning. The PEP, titled Additional Unpacking Generalizations, …

  2. python - What does list [x::y] do? - Stack Overflow

    Jan 27, 2012 · Possible Duplicate: Good Primer for Python Slice Notation I've been reading over some sample code lately and I've read quite a few websites but I just can't seem to get the …

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

    I am more and more dissiapointed with python 'functional' capabilities. In haskell there is find function in Data.List module that doing exactly that. But in python it's not and it's to small to …

  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 - List attributes of an object - Stack Overflow

    7 In addition to these answers, I'll include a function (python 3) for spewing out virtually the entire structure of any value. It uses dir to establish the full list of property names, then uses getattr …

  6. Python append () vs. += operator on lists, why do these give …

    Python lists are heterogeneous that is the elements in the same list can be any type of object. The expression: c.append(c) appends the object c what ever it may be to the list. In the case it …

  7. python - Getting a list of all subdirectories in the current directory ...

    Jun 10, 2009 · Is there a way to return a list of all the subdirectories in the current directory in Python? I know you can do this with files, but I need to get the list of directories instead.

  8. Best and/or fastest way to create lists in python

    In python, as far as I know, there are at least 3 to 4 ways to create and initialize lists of a given size: Simple loop with append: my_list = [] for i in range(50): my_list.append(0) Simple ...

  9. python - How to concatenate (join) items in a list to a single string ...

    Sep 17, 2012 · For handling a few strings in separate variables, see How do I append one string to another in Python?. For the opposite process - creating a list from a string - see How do I …

  10. python - How can I find the index for a given item in a list? - Stack ...

    ValueError: 2 is not in list If this is a concern, either explicitly check first using item in my_list, or handle the exception with try / except as appropriate. The explicit check is simple and …