Advertisement
veronikaaa86

04. Easter Eggs Battle

Feb 19th, 2022
425
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. first_player_eggs = int(input())
  2. second_player_eggs = int(input())
  3.  
  4. line_input = input()
  5. while line_input != "End of battle":
  6. if line_input == "one":
  7. second_player_eggs = second_player_eggs - 1
  8. elif line_input == "two":
  9. first_player_eggs = first_player_eggs - 1
  10.  
  11. if first_player_eggs == 0 or second_player_eggs == 0:
  12. break
  13.  
  14. line_input = input()
  15.  
  16. if first_player_eggs == 0:
  17. print(f"Player one is out of eggs. Player two has {second_player_eggs} eggs left.")
  18. elif second_player_eggs == 0:
  19. print(f"Player two is out of eggs. Player one has {first_player_eggs} eggs left.")
  20. else:
  21. print(f"Player one has {first_player_eggs} eggs left.")
  22. print(f"Player two has {second_player_eggs} eggs left.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement