Python中append和extend的区别

时间:2021-06-04 19:55:30   收藏:0   阅读:0
#假定存在两个列表,a和b
a = [1,2,3]
b = [4,5,6]
a.append(b)
a

技术图片

 

 

a = [1,2,3]
a.extend(b)
a

技术图片

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!