Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Using Variables | Variables and Types
Introduction to Python

Using 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:

Tarefa

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.

Tudo estava claro?

Seção 2. Capítulo 3
toggle bottom row
course content

Conteúdo do Curso

Introduction to Python

Using 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:

Tarefa

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.

Tudo estava claro?

Seção 2. Capítulo 3
toggle bottom row
some-alt