Teo_Yanchev

easter_egg_battle_20-21-2019_exam

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