daily pastebin goal
69%
SHARE
TWEET

Untitled

a guest Jan 20th, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. genome=input()
  2. s=""
  3. count=1
  4. k=len(genome)
  5.  
  6. for i in range(1,k):    
  7.     if genome[i]==genome[i-1]:
  8.         count+=1
  9.     else:
  10.         s=s+genome[i-1]+str(count)
  11.         count=1
  12.     if i==k-1:
  13.         s=s+genome[i]+str(count)
  14.  
  15. print(s)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top