Take the content of a list and append it to another list

后端 未结 7 1754
死守一世寂寞
死守一世寂寞 2020-12-07 08:55

I am trying to understand if it makes sense to take the content of a list and append it to another list.

I have the first list created through a loop function, that

7条回答
  •  我在风中等你
    2020-12-07 09:13

    You can also combine two lists (say a,b) using the '+' operator. For example,

    a = [1,2,3,4]
    b = [4,5,6,7]
    c = a + b
    
    Output:
    >>> c
    [1, 2, 3, 4, 4, 5, 6, 7]
    

提交回复
热议问题