Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- houses = [int(el) for el in input().split("@")]
- command = input()
- position = 0
- while not command == "Love!":
- task, value = command.split()
- position += int(value)
- if position >= len(houses):
- position = 0
- if houses[position] == 0:
- print(f"Place {position} already had Valentine's day.")
- else:
- houses[position] -= 2
- if houses[position] == 0:
- print(f"Place {position} has Valentine's day.")
- command = input()
- print(f"Cupid's last position was {position}.")
- houses_left = len([el for el in houses if not el == 0])
- if houses_left > 0:
- print(f"Cupid has failed {houses_left} places.")
- else:
- print("Mission was successful.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement