python之append和extend的区别
list.append(object) 向列表中添加一个对象object
list.extend(sequence) 把一个序列seq的内容添加到列表中
a = ['a','aa','aaa'] b = ['B','BB','BBB'] c = ['C','CC','CCC'] a.append(b) print(a) #['a', 'aa', 'aaa', ['B', 'BB', 'BBB']] b.extend(c) print(b) #['B', 'BB', 'BBB', 'C', 'CC', 'CCC']