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