Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- text = input()
- formatted_text = ""
- power = 0
- for idx in range(len(text)):
- if power > 0 and text[idx] != ">":
- power -= 1
- elif text[idx] == ">":
- formatted_text += text[idx]
- power += int(text[idx + 1])
- else:
- formatted_text += text[idx]
- print(formatted_text)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement