chevron_left
Cookbooks
Accessing an item in a listAdding items to a listChecking if a list is emptyChecking whether a value is in a listConcatenating two listsCopying a list in PythonDifference between append and extend methodsDifference between sort and sortedFinding the index of an element in a listFinding the length of a listIterating from index oneLooping through listsModifying listsPrinting a list in reverse orderRemoving items from a listSorting a listUsing enumerate and zip at the same time
0
0
0
new
Concatenating two lists in Python
Programming
chevron_rightPython
chevron_rightOperations
chevron_rightList Operations
chevron_rightCookbooks
schedule Mar 10, 2022
Last updated Python
Tags tocTable of Contents
expand_more The easiest way to concatenate two lists is to use the +
operator.
[1, 2, 3, 4, 5, 6]
Alternatively you can leverage the list.extend(~)
method:
In this case the original list x
is modified.
Published by Isshin Inada
Edited by 0 others
Did you find this page useful?
Ask a question or leave a feedback...