1import itertools
2a = [['a','b'], ['c']]
3print(list(itertools.chain.from_iterable(a)))
4
1# Basic syntax:
2first_list.append(second_list) # Append adds the the second_list as an
3# element to the first_list
4first_list.extend(second_list) # Extend combines the elements of the
5# first_list and the second_list
6
7# Note, both append and extend modify the first_list in place
8
9# Example usage for append:
10first_list = [1, 2, 3, 4, 5]
11second_list = [6, 7, 8, 9]
12first_list.append(second_list)
13print(first_list)
14--> [1, 2, 3, 4, 5, [6, 7, 8, 9]]
15
16# Example usage for extend:
17first_list = [1, 2, 3, 4, 5]
18second_list = [6, 7, 8, 9]
19first_list.extend(second_list)
20print(first_list)
21--> [1, 2, 3, 4, 5, 6, 7, 8, 9]
1x = [["a","b"], ["c"]]
2
3result = sum(x, [])
4# This combines the lists within the list into a single list