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

Conteúdo do 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

Tarefa

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

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 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

Tarefa

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

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 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

Tarefa

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

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

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

Tarefa

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

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Seção 2. Capítulo 6
Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
some-alt