参考自网页: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]
参考自网页: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]
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。