如何对数组中的每个n元素进行分组(使用set()):python

时间:2015-07-29 19:37:45

标签: python arrays python-3.x

如果已经提出这个问题,我很抱歉,但我无法找到答案。 我有一个元素列表。我想为数组中的每4个元素分组元素。 例如:

my_list = ["A","B","C","D","E","F","G","H",....]

result = [{"A","B","C","D"},{"E","F","G","H"},....]

0 个答案:

没有答案