javahouse

内容过程中,把写内容过程中常用的内容收藏起来,下面的资料是关于python将两个数组合并成一个数组的两种方法的内容,希望能对小伙伴们有帮助。
c1 = ["Red","Green","Blue"]
c2 = ["Orange","Yellow","Indigo"]
c1.extend(c2)

assert c1 == ["Red","Green","Blue","Orange","Yellow","Indigo"]





下面使用+号操作符



c1 = ["Red","Green","Blue"]
c2 = ["Orange","Yellow","Indigo"]
c3 = c1 + c2

assert c3 == ["Red","Green","Blue","Orange","Yellow","Indigo"]




 

分类:

技术点:

相关文章:

  • 2022-03-14
  • 2022-02-04
  • 2021-11-19
  • 2021-11-19
  • 2021-12-26
猜你喜欢
  • 2022-12-23
  • 2022-01-28
  • 2021-05-18
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案