a = [1,2] a += [3,4] print(a)
输出:[1, 2, 3, 4]
a = [1,2] a.extend([3,4]) print(a) 输出: [1, 2, 3, 4]
a = [1,2] a.append([3,4]) print(a) 输出:[1, 2, [3, 4]]
本文来自博客园,作者:孙龙-程序员,转载请注明原文链接:https://www.cnblogs.com/sunlong88/articles/10778858.html
a = [1,2] a += [3,4] print(a)
输出:[1, 2, 3, 4]
a = [1,2] a.extend([3,4]) print(a) 输出: [1, 2, 3, 4]
a = [1,2] a.append([3,4]) print(a) 输出:[1, 2, [3, 4]]
本文来自博客园,作者:孙龙-程序员,转载请注明原文链接:https://www.cnblogs.com/sunlong88/articles/10778858.html