course content

Course Content

Introduction to Python

Using VariablesUsing Variables

In the first lesson of this section, you set up a variable named chapter. Now, how can we tweak or change variables we've already set up? The good news is, you can adjust them just like you did with the values in the previous lessons.

Let's say you've got the cost of an item saved in the price variable and you want to apply a 15% discount. You can simply reassign the updated value like this:

Task

Since you first set up the chapter variable, you've gone through two more chapters. Add 2 to the chapter variable and reassign this new value to it.

Everything was clear?

Section 2. Chapter 3
toggle bottom row