how to append multiple items to a list in python code example
Example 1: append two items to list
my_list = ['a']
my_list.append('b')
my_list.extend(('b','c'))
Example 2: append multiple strings to list python
>>> lst = [1, 2]
>>> lst.append(3)
>>> lst.append(4)
>>> lst
[1, 2, 3, 4]
>>> lst.extend([5, 6, 7])
>>> lst.extend((8, 9, 10))
>>> lst
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
>>> lst.extend(range(11, 14))
>>> lst
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
Example 3: python append multiple values
list.extend(val1,val2,val3....)
list.extend( [val1,val2],val3,val4,[val5,val6,val7])