SHARE
TWEET

Untitled

a guest May 26th, 2019 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. number_of_eggs_player_1 = int(input())
  2. number_of_eggs_player_2 = int(input())
  3.  
  4.  
  5.  
  6. eggs_counter_player_1 = number_of_eggs_player_1
  7. eggs_counter_player_2 = number_of_eggs_player_2
  8.  
  9. while not eggs_counter_player_2 == 0 or not eggs_counter_player_1 == 0:
  10.     winner = input()
  11.  
  12.     if winner == "End of battle":
  13.         break
  14.  
  15.     if winner == "one":
  16.         eggs_counter_player_2 -= 1
  17.     elif winner == "two":
  18.         eggs_counter_player_1 -= 1
  19.  
  20.     if eggs_counter_player_1 == 0 or eggs_counter_player_2 == 0:
  21.         break
  22.  
  23.  
  24.  
  25. if eggs_counter_player_1 == 0:
  26.     print(f"Player one is out of eggs. Player two has {eggs_counter_player_2} eggs left.")
  27. elif eggs_counter_player_2 == 0:
  28.     print(f"Player two is out of eggs. Player one has {eggs_counter_player_1} eggs left.")
  29. else:
  30.     print(f"Player one has {eggs_counter_player_1} eggs left.")
  31.     print(f"Player two has {eggs_counter_player_2} eggs left.")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top