Advertisement
Guest User

Untitled

a guest
Apr 16th, 2022
427
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.80 KB | None | 0 0
  1. count_eggs_first_player = int(input())
  2. count_eggs_second_player = int(input())
  3.  
  4. while True:
  5.     command = input()
  6.     winner = command
  7.     if winner == "one":
  8.         count_eggs_second_player = count_eggs_second_player - 1
  9.     elif winner == "two":
  10.         count_eggs_first_player = count_eggs_first_player - 1
  11.  
  12.     if count_eggs_first_player <= 0:
  13.         print(f"Player one is out of eggs. Player two has {count_eggs_second_player} eggs left.")
  14.         break
  15.     elif count_eggs_second_player <= 0:
  16.         print(f"Player two is out of eggs. Player one has {count_eggs_first_player} eggs left.")
  17.         break
  18.     elif command == "End":
  19.         print(f"Player one has {count_eggs_first_player} eggs left.")
  20.         print(f"Player two has {count_eggs_second_player} eggs left.")
  21.         break
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement