Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- s = 'aaaabbсaaakkkkkkz'
- c = 1
- for i in range(1, len(s)):
- if s[i-1] == s[i]:
- c += 1
- else:
- print(s[i-1], c, sep = '', end = '')
- c = 1
- print(s[i], c, sep = '', end = '')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement