Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- x = input()
- i = 0
- cnt = 1
- while (i < len(x)) :
- if (x[i] == x[i+1]) :
- cnt = cnt + 1
- else:
- print(x[i], end='')
- print(cnt, end='')
- cnt=1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement