参考自网页:https://www.stechies.com/concatenate-merge-two-or-multiple-lists-in-python/

我认为最好的一个方法是:

list1 = [2,3,4,2,2]
list2 = [4,5,6,7,34,56]
list3 = [1,5,33,2,34,46]

# Concatenate lists
newlist = [y for x in [list1, list2, list3] for y in x]

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-16
  • 2022-12-23
  • 2021-10-20
  • 2021-12-03
猜你喜欢
  • 2022-12-23
  • 2021-08-19
  • 2022-12-23
  • 2022-12-23
  • 2022-01-06
相关资源
相似解决方案