📜  如何在python代码示例中加入两个列表

📅  最后修改于: 2022-03-11 14:45:25.844000             🧑  作者: Mango

代码示例6
#define lists
my_list = ["a", "b"]
other_list = [1, 2]

#extend my_list by adding all the values from other_list into my list
my_list.extend(other_list)

# output: ['a', 'b', 1, 2]