how to append two list in python code example
Example 1: append two items to list
my_list = ['a']
# You can use list.append(value) to append a single value:
my_list.append('b')
# my_list should look like ['a','b']
# and list.extend(iterable) to append multiple values.
my_list.extend(('b','c'))
# my_list should look like ['a','b','c']
Example 2: python merge two list
listone = [1,2,3]
listtwo = [4,5,6]
joinedlist = listone + listtwo
Example 3: append two list of number to one python
listone = [1,2,3]
listtwo = [4,5,6]
mergedlist = []
mergedlist.extend(listone)
mergedlist.extend(listtwo)
Example 4: merge lists in list python
import itertools
a = [['a','b'], ['c']]
print(list(itertools.chain.from_iterable(a)))