标签:style blog class code java ext
1 from itertools import groupby 2 def compress(data): 3 return ((len(list(group)),name) 4 for name,group in groupby(data)) 5 def decompress(data): 6 return (car*size for size,car in data) 7 if __name__ == ‘__main__‘: 8 l=list(compress(‘get uuuuuuuuuuuuuuuup‘)) 9 print l 10 print ‘‘.join(decompress(l))
标签:style blog class code java ext
原文地址:http://www.cnblogs.com/chengxuyuanxiaoye/p/3718338.html