View difference between Paste ID: DREc4hhm and zAwLzfLq
SHOW: | | - or go back to the newest paste.
1
x = input() 
2
i = 0 
3
cnt = 1  
4
while (i < len(x)) : 
5
    if (x[i] == x[i+1]) : 
6
        cnt = cnt + 1 
7
    else:
8
        print(x[i], end='')
9-
        print(cnt, end='')
9+
        print(cnt, end='')
10
		cnt=1