如何在 Python 中连接两个列表?
例子:
listone = [1, 2, 3] listtwo = [4, 5, 6]
预期结果:
>>> joinedlist [1, 2, 3, 4, 5, 6]
您可以使用+运算符来组合它们:
+
listone = [1, 2, 3] listtwo = [4, 5, 6] joinedlist = listone + listtwo
输出: