「JavaScript入門」groupby()のサンプル
サンプルコード
import itertools
Str = '122333<<<<'
Lst = []
for key,group in itertools.groupby(s):
Lst.append(list(group))
print map(lambda x: ".join(x), Lst)
結果
['1′, ’22’, '333’, '<<<<']
Coding Changes the World
サンプルコード
import itertools
Str = '122333<<<<'
Lst = []
for key,group in itertools.groupby(s):
Lst.append(list(group))
print map(lambda x: ".join(x), Lst)
結果
['1′, ’22’, '333’, '<<<<']