나는 이렇게 학습한다/Algorithm & SQL

0928. Grasshopper - Terminal game combat function

daco2020 2022. 9. 28. 22:50
반응형

Create a combat function that takes the player's current health and the amount of damage recieved, and returns the player's new health. Health can't be less than 0.



Solution:

def combat(health, damage):
    return max(health-damage, 0)


반응형