Guest User

Untitled

a guest
Mar 23rd, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.13 KB | None | 0 0
  1. >>> from itertools import groupby
  2. >>> s = 'BWWWBWWBW'
  3. >>> [''.join(i[1]) for i in groupby(s)]
  4. ['B', 'WWW', 'B', 'WW', 'B', 'W']
Add Comment
Please, Sign In to add comment