Guest User

Untitled

a guest
Jul 20th, 2017
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.16 KB | None | 0 0
  1. import re
  2.  
  3.  
  4. def zip_dna(dna):
  5.     return ''.join(map(lambda x: x[0] + str(len(x[0] + x[1])), re.findall(r'([a-zA-z])(\1*)', dna)))
  6.  
  7.  
  8. print(zip_dna(input()))
Add Comment
Please, Sign In to add comment