Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- commands = input()
- char = commands[0]
- line = [char]
- x = 0
- for command in commands:
- if command == '<':
- line[x - 1] = char
- x -= 1
- elif command == '>':
- line.append(char)
- x += 1
- elif command == 'V':
- print(*line, sep='')
- line.clear()
- for i in range(x):
- line.append(' ')
- line.append(char)
- print(*line, sep='')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement