Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/env python
- s=input()
- h=''
- count=''
- uz=''
- for x in s:
- if x.isalpha():
- if h != '':
- uz+=h*(1 if count =='' else int(count))
- h=x
- count=''
- elif x.isdigit():
- count+=x
- else:
- if h != '':
- uz+=h*(1 if count =='' else int(count))
- #should not happen for our case. input could be invalid
- count=''
- h=''
- #warn if necessary
- if h != '':
- uz+=h*(1 if count =='' else int(count))
- print(uz)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement