Merge two lists in python

lista = [1,2,3]
listb = [4,5,6]
 
list = lista + listb

another way to do it would be

list = []
list.extend(lista)
list.extend(listb)

#outcome to expect: list == [1, 2, 3, 4, 5, 6]

Enjoyed this post? Share it!