Append multiple items to a list : List Extend « List « Python






Append multiple items to a list

Append multiple items to a list

L = [1, 2]
L.extend([3,4,5])      # append multiple items
print L

           
       








Related examples in the same category

1.List: The Difference Between Extend and AppendList: The Difference Between Extend and Append
2.Adding Elements to ListsAdding Elements to Lists