Skip to content

Latest commit

 

History

History
14 lines (11 loc) · 379 Bytes

10 怎么在列表末尾加入其它元素.md

File metadata and controls

14 lines (11 loc) · 379 Bytes

Python100

把Python知识点整理成100道习题,知识点来自两本书:Python基础教程(第3版)和流畅的Python,以后会定期加入更多的习题,大家帮忙点个赞哈,点赞越多,更新越快~

怎么在列表末尾加入其它元素

用 extend 方法

>>> l = [1, 2, 3]
>>> j = [4, 5, 6]
>>> l.extend(j)
>>> l
[1, 2, 3, 4, 5, 6]