from collections import Counter text=input() if(text==None): print(" ") if(text.isalpha()): dict1=dict(Counter(text)) for i,j in dict1.items(): print(i,j,end="",sep="")
Python
C
s = 'aaabbaa' c = s[0] n = 1 o = c for k in range(1, len(s)): o = s[k] if o == c: n = n + 1 else: print(c,n, sep='', end='') n = 1 c = o print(o,n, sep='')
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)