0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 4
click for more info
No active XP Potion
Accept a Quest
Login to submit answers
Variables are called "variables" because they can hold any value and that value can change (it varies).
For example, this code prints 20
:
acceleration = 10
acceleration = 20
print(acceleration)
The line acceleration = 20
reassigns the value of acceleration
to 20. It overwrites whatever was being held in the acceleration
variable before (10 in this case).
We need to reduce our hero's health as they take damage.
Before each print()
function in the provided code, change the value of player_health
to 100 less than it was before.
The final output should look like this:
900
800
700
600
Focus Editor
Alt+Shift+]
Login to Submit
Login to Run
Login to view solution