Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- s = input()
- if s == '()':
- print()
- else:
- for i in range(s.count('(')):
- y = s.find(')')
- x = s.rfind('(')
- s1 = s[x+1:y]
- a = ''
- while '0' <= s1[0] <= '9':
- a += s1[0]
- s1 = s1[1:]
- s1 = s1*int(a)
- s = s.replace(s[x:y+1], s1, 1)
- print(s)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement