About 54 results
Open links in new tab
  1. What is the difference between Python's list methods append and …

    Oct 31, 2008 · What is the difference between the list methods append and extend? .append() adds its argument as a single element to the end of a list. The length of the list itself will increase by one. …

  2. python - Concatenating two lists - difference between '+=' and extend ...

    ary.extend (ext) merely adds reference to "ext" list to the end of the "ary" list, resulting in less memory transactions. As a result, .extend works orders of magnitude faster and doesn't use any additional …

  3. python - Append vs extend efficiency - Stack Overflow

    As we can see, extend with list comprehension is still over two times faster than appending. Generator expressions appear noticeably slower than list comprehension. append_comp only introduces …

  4. Use of add(), append(), update() and extend() in Python

    Is there an article or forum discussion or something somewhere that explains why lists use append/extend, but sets and dicts use add/update? I frequently find myself converting lists into sets …

  5. python - Num list, qual é a diferença entre append e extend? - Stack ...

    Dec 9, 2016 · Num list em Python, existem os métodos append e extend. Qual é a diferença entre eles e quando devo usar cada um?

  6. python - В чем разница между extend и append? - Stack Overflow на …

    Jun 28, 2022 · a.extend(a) это скорее for x in list(a): a.append(x), потому, что что цикл в вашем примере будет бесконечным (пока не съест всю память) из за того, что a пополняется в …

  7. python - Extending list returns None - Stack Overflow

    May 2, 2015 · The function extend is an in-place function i.e. it will make the changes to the original list itself. From the docs Extend the list by appending all the items in the given list; equivalent to a [len …

  8. Python "extend" for a dictionary - Stack Overflow

    Python "extend" for a dictionary Asked 16 years, 11 months ago Modified 3 years, 2 months ago Viewed 556k times

  9. python - Can someone explain how .extend () works in depth for this ...

    Jul 8, 2019 · In any case, the answer here is simple, .extend is a method that works in-place on list objects, and will return None (which is generally true for mutator methods of Python built-in objects).

  10. python - Extend list with another list in specific index ... - Stack ...

    Jan 15, 2023 · Closed 3 years ago. In python we can add lists to each other with the extend () method but it adds the second list at the end of the first list.