推 grtfor: 拜訪list元素,一遇到'f'就把拜訪次數yield出去 09/27 13:22
→ bigpigbigpig: L1 = ['t','t','f','t','t','t','f','t'] 09/27 14:52
→ bigpigbigpig: L2 = list(map(len, ''.join(L1).split('f'))) 09/27 14:52
推 ckclark: from itertools import groupby 09/27 18:55
→ ckclark: [len(list(v)) for k, v in groupby(data) if k == 't'] 09/27 18:55