Conteúdo do Curso
Python Loops Tutorial
Python Loops Tutorial
Pass, 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:
counter = 0 while counter < 10: counter += 1 pass
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:
counter = 0 while counter < 10: print(counter) counter += 1 else: print('Done!')
Swipe to show code editor
Fill in the gaps with while
, pass
, and else
.
Obrigado pelo seu feedback!
Pass, 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:
counter = 0 while counter < 10: counter += 1 pass
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:
counter = 0 while counter < 10: print(counter) counter += 1 else: print('Done!')
Swipe to show code editor
Fill in the gaps with while
, pass
, and else
.
Obrigado pelo seu feedback!
Pass, 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:
counter = 0 while counter < 10: counter += 1 pass
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:
counter = 0 while counter < 10: print(counter) counter += 1 else: print('Done!')
Swipe to show code editor
Fill in the gaps with while
, pass
, and else
.
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:
counter = 0 while counter < 10: counter += 1 pass
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:
counter = 0 while counter < 10: print(counter) counter += 1 else: print('Done!')
Swipe to show code editor
Fill in the gaps with while
, pass
, and else
.