Untitled
unknown
plain_text
8 months ago
777 B
1
Indexable
Never
eggs_player_one = int(input()) eggs_player_two = int(input()) winner = None while True: command = input() if command == "End": break if command == "one": eggs_player_two -= 1 elif command == "two": eggs_player_one -= 1 if eggs_player_one == 0 or eggs_player_two == 0: break if eggs_player_one == 0: winner = "Player one" elif eggs_player_two == 0: winner = "Player two" if winner: print(f"{winner} is out of eggs. {('Player two' if winner == 'Player one' else 'Player one')} has {eggs_player_one if winner == 'Player two' else eggs_player_two} eggs left.") else: print(f"Player one has {eggs_player_one} eggs left.") print(f"Player two has {eggs_player_two} eggs left.")
Leave a Comment