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