Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- genome=input()
- s=""
- count=1
- k=len(genome)
- for i in range(1,k):
- if genome[i]==genome[i-1]:
- count+=1
- else:
- s=s+genome[i-1]+str(count)
- count=1
- if i==k-1:
- s=s+genome[i]+str(count)
- print(s)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement