Understanding Negative Values
Numbers in Python can be positive or negative.
If a number is positive, it increases something.
If a number is negative, it decreases something.
To make a number negative, simply place a minus sign in front of it.
Example:
damage = -10This tells the program to subtract 10 instead of add 10.
In World of Software Engineering, our hero has stepped into hot lava.
Instead of losing health, the hero is accidentally gaining health.
We need to fix that.
Assignment:
Change the value of
Change the value of
lava_damage so that it reduces health instead of increasing it.
Do not modify any other lines of code.
Fix the lava damage
player_health = 100 lava_damage = 10 # don't edit the code below player_lava_health = player_health + lava_damage print(player_lava_health)