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