We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Variables Vary

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).

Assignment

Our hero's health starts at 1000, notice that the current code prints it.

After the 1000 is printed, add a line that changes player_health to 500 so that the next line prints 500.

The final output should look like this:

1000
500