import itertools
原tweet = "I luv my <3 iphone & youre awsm apple. DisplayIsAwesome, sooo happppppy :) http://www.apple.com"
经过tweet = ''.join(''.join(s)[:2] for _, s in itertools.groupby(tweet))
结果tweet = "I luv my <3 iphone & youre awsm apple. DisplayIsAwesome, soo happy :) http://ww.apple.com"
求指教实现过程是怎么样的?
1
Shared 2015-02-02 21:13:05 +08:00 1
查 itertools 的 groupby 用法
|
2
letv 2015-02-02 21:15:39 +08:00
中文变量名。。。
|
4
zerh925 2015-02-03 09:06:53 +08:00
学好语文再来提问
|
5
xwsoul 2015-02-03 10:29:14 +08:00 1
|