Advertisement
Guest User

Untitled

a guest
Mar 19th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.26 KB | None | 0 0
  1. x=input()
  2. X=""
  3. for char in 'a','b','c':
  4.     curCharCount=1
  5.     while True:
  6.       curPos=x.find(char)
  7.       while x[1+curPos]==char:
  8.         curCharCount+=1
  9.       X=X+char+str(curCharCount)
  10.       x=x[curPos+curCharCount:]
  11.       if x=="":
  12.         break
  13. print(X)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement