Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- energy = int(input())
- won = 0
- command = input()
- while True:
- if command == "End of battle":
- print(f"Won battles: {won}. Energy left: {energy}")
- break
- distance = int(command)
- if energy < distance:
- print(f"Not enough energy! Game ends with {won} won battles and 0 energy")
- break
- if energy >= distance:
- won += 1
- energy -= distance
- if won % 3 == 0:
- energy += won
- command = input()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement