Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Pass, Else in a while Loop | The while Loop
Python Loops Tutorial
course content

Contenido del Curso

Python Loops Tutorial

Python Loops Tutorial

1. The for Loop
2. The while Loop
3. Nested Loops

bookPass, Else in a while Loop

Allow me to remind you that the pass statement is a null statement. When executed, it results in no action.

Examine the code below:

12345
counter = 0 while counter < 10: counter += 1 pass
copy

Additionally, as a reminder, in Python, a loop can include the else block, which executes when the loop terminates under normal conditions.

Examine the code below:

1234567
counter = 0 while counter < 10: print(counter) counter += 1 else: print('Done!')
copy
Tarea
test

Swipe to show code editor

Fill in the gaps with while, pass, and else.

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 2. Capítulo 6
toggle bottom row

bookPass, Else in a while Loop

Allow me to remind you that the pass statement is a null statement. When executed, it results in no action.

Examine the code below:

12345
counter = 0 while counter < 10: counter += 1 pass
copy

Additionally, as a reminder, in Python, a loop can include the else block, which executes when the loop terminates under normal conditions.

Examine the code below:

1234567
counter = 0 while counter < 10: print(counter) counter += 1 else: print('Done!')
copy
Tarea
test

Swipe to show code editor

Fill in the gaps with while, pass, and else.

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 2. Capítulo 6
toggle bottom row

bookPass, Else in a while Loop

Allow me to remind you that the pass statement is a null statement. When executed, it results in no action.

Examine the code below:

12345
counter = 0 while counter < 10: counter += 1 pass
copy

Additionally, as a reminder, in Python, a loop can include the else block, which executes when the loop terminates under normal conditions.

Examine the code below:

1234567
counter = 0 while counter < 10: print(counter) counter += 1 else: print('Done!')
copy
Tarea
test

Swipe to show code editor

Fill in the gaps with while, pass, and else.

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Allow me to remind you that the pass statement is a null statement. When executed, it results in no action.

Examine the code below:

12345
counter = 0 while counter < 10: counter += 1 pass
copy

Additionally, as a reminder, in Python, a loop can include the else block, which executes when the loop terminates under normal conditions.

Examine the code below:

1234567
counter = 0 while counter < 10: print(counter) counter += 1 else: print('Done!')
copy
Tarea
test

Swipe to show code editor

Fill in the gaps with while, pass, and else.

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
Sección 2. Capítulo 6
Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
We're sorry to hear that something went wrong. What happened?
some-alt