📅  最后修改于: 2022-03-11 14:48:16.735000             🧑  作者: Mango
def split_list(a_list, number):
splitNumber = len(a_list) // number
result = [a_list[x:x+splitNumber] for x in range(0, len(a_list), splitNumber)]
if(len(result) > number):
result[len(result) - 2] = result[len(result) - 2]+ result[len(result)-1]
result.pop()
return result
a = [i for i in range(11)]
print(split_list(a,3))