append contecnts to list python code example
Example 1: python add all values of another list
a = [1, 2, 3]
b = [4, 5, 6]
a += b
# another way: a.extend(b)
Example 2: append a list to another list as element
a = ['Jon', 'janni', 'Jannardhan']
b = ['28', '29', '30']
a.append(b)
print(a)
a.pop()
a.extend(b)
print(a)