0

如何从以下位置制作列表列表:

data = ['a','b','c','d','e','f','g','h','i']

data = [['a','b','c'],['d','e','f'],['g','h','i']]
4

1 回答 1

1
[a[i:i+3] for i in range(0, len(a), 3)]
于 2013-06-08T03:38:01.953 回答