Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- weapon_name = [el for el in input().split("|")]
- command = input().split()
- while "Done" not in command:
- if "Move" in command:
- index = int(command[2])
- if "Right" in command:
- if 0 <= index < len(weapon_name):
- weapon_name.insert(index + 2, weapon_name[index])
- weapon_name.remove(weapon_name[index])
- elif "Left" in command:
- if 0 < index <= len(weapon_name):
- weapon_name.insert(index - 1, weapon_name[index])
- weapon_name.pop(index + 1)
- elif "Odd" in command:
- odds = []
- for i in range(len(weapon_name)):
- if i % 2 == 1:
- odds.append(weapon_name[i])
- odds = " ".join(odds)
- print(odds)
- elif "Even" in command:
- evens = []
- for i in range(len(weapon_name)):
- if i % 2 == 0:
- evens.append(weapon_name[i])
- evens = " ".join(evens)
- print(evens)
- command = input().split()
- weapon_name = "".join(weapon_name)
- print(f"You crafted {weapon_name}!")
Add Comment
Please, Sign In to add comment