如何在成对元素上拆分列表? [英] How to split the list on the pairwise elements?

查看:55
本文介绍了如何在成对元素上拆分列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
如何将列表平均划分大小的Python块?

Possible Duplicate:
How do you split a list into evenly sized chunks in Python?

让我们有一个列表,总会有偶数个元素.我们必须通过配对将其分解. 例子: list ['1','2','3','4'] 需要 1,2和3,4

Let us have a list, there is always an even number of elements. We must break it down by pairing. Example: list['1','2','3','4'] need 1,2 and 3,4

推荐答案

查看全文

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆