Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string = input().split("|")
- command = input()
- while command != 'Done':
- if 'Left' in command:
- tokens = command.split()
- move = int(tokens[2])
- if move > len(string):
- pass
- elif move == 0:
- pass
- else:
- string[move], string[move - 1] = string[move - 1], string[move]
- elif 'Right' in command:
- tokens = command.split()
- move = int(tokens[2])
- if move >= len(string):
- pass
- else:
- string[move], string[move + 1] = string[move + 1], string[move]
- elif 'Even' in command:
- print(' '.join(string[::2]))
- elif 'Odd' in command:
- print(' '.join(string[1::2]))
- command = input()
- final = ''.join(string)
- print(f'You crafted {final}!')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement