Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
El primer bucle while | The while Loop
Python Loops Tutorial

El primer bucle whileEl primer bucle while

Let's proceed!

The while loop!

The while statement verifies a condition. The condition should yield a Boolean value, which can be either True or False.

If the condition evaluates to True, the while statement executes the statements contained within its block.

The while statement keeps reevaluating the condition with each iteration and continues to execute its block until the condition becomes False.

Take a look at the code below:

How does the code work?

Tarea

Print numbers from 10 to 0.

  1. Initialize the while loop with the variable i.
  2. Continuously print the numbers while the loop is active.
  3. Decrease i by 1 with each iteration.

¿Todo estuvo claro?

Sección 2. Capítulo 1
toggle bottom row
course content

Contenido del Curso

Python Loops Tutorial

El primer bucle whileEl primer bucle while

Let's proceed!

The while loop!

The while statement verifies a condition. The condition should yield a Boolean value, which can be either True or False.

If the condition evaluates to True, the while statement executes the statements contained within its block.

The while statement keeps reevaluating the condition with each iteration and continues to execute its block until the condition becomes False.

Take a look at the code below:

How does the code work?

Tarea

Print numbers from 10 to 0.

  1. Initialize the while loop with the variable i.
  2. Continuously print the numbers while the loop is active.
  3. Decrease i by 1 with each iteration.

¿Todo estuvo claro?

Sección 2. Capítulo 1
toggle bottom row
some-alt