1l = ['aaa', 'bbb', 'ccc']
2
3s = ''.join(l)
4print(s)
5# aaabbbccc
6
7s = ','.join(l)
8print(s)
9# aaa,bbb,ccc
10
11s = '-'.join(l)
12print(s)
13# aaa-bbb-ccc
14
15s = '\n'.join(l)
16print(s)
17# aaa
18# bbb
19# ccc
20
1>>> sentence = ['this','is','a','sentence']
2>>> '-'.join(sentence)
3'this-is-a-sentence'
1a = [1, 2, 3]
2b = [4, 5]
3
4# method 1:
5c = a + b # forms a new list with all elements
6print(c) # [1, 2, 3, 4, 5]
7
8# method 2:
9a.extend(b) # adds the elements of b into list a
10print(a) # [1, 2, 3, 4, 5]