Teo_Yanchev

game_number_wars_9-10-2019_exam

Jul 14th, 2020
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. name_player_one = input()
  2. name_player_two = input()
  3.  
  4. player_one_points = 0
  5. player_two_points = 0
  6.  
  7. command = input()
  8. while True:
  9. if command == "End of game":
  10. print(f"{name_player_one} has {player_one_points} points")
  11. print(f"{name_player_two} has {player_two_points} points")
  12. break
  13. player_one_card = int(command)
  14. player_two_card = int(input())
  15.  
  16. if player_one_card > player_two_card:
  17. player_one_points += (player_one_card - player_two_card)
  18. elif player_one_card < player_two_card:
  19. player_two_points += (player_two_card - player_one_card)
  20. else:
  21. print("Number wars!")
  22. last_card_player_one = int(input())
  23. last_card_player_two = int(input())
  24. if last_card_player_one > last_card_player_two:
  25. print(f"{name_player_one} is winner with {player_one_points} points")
  26. break
  27. else:
  28. print(f"{name_player_two} is winner with {player_two_points} points")
  29. break
  30.  
  31. command = input()
Advertisement
Add Comment
Please, Sign In to add comment