python将两个数组合并成⼀个数组的两种⽅法的代码
内容过程中,把写内容过程中常⽤的内容收藏起来,下⾯的资料是关于python将两个数组合并成⼀个数组的两种⽅法的内容,希望能对⼩伙伴们有帮助。
c1 = ["Red","Green","Blue"]
c2 = ["Orange","Yellow","Indigo"]
assert c1 == ["Red","Green","Blue","Orange","Yellow","Indigo"]
下⾯使⽤+号操作符
c1 = ["Red","Green","Blue"]
c2 = ["Orange","Yellow","Indigo"]
c3 = c1 + c2
python数组合并assert c3 == ["Red","Green","Blue","Orange","Yellow","Indigo"]
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论