Professional Documents
Culture Documents
Lecture 8 - 2 Loops
Lecture 8 - 2 Loops
Lecture 8 - 2 Loops
➢ One last thing on while loops is that we can use the else statement
again, this time with a different meaning: the indented code below the
else clause will be executed only when the condition specified in the
while statement becomes False..
Python 3 Loops - While / While-Else
Python 3 Nesting - If / For / While
➢ You can use nesting with control flow statements like if, for and while,
to enable a certain behavior and logic inside your Python program.
➢ Think of nesting as using an if statement inside another if statement,
a for loop inside another for loop or a while loop within another
while loop.
➢ Lets look at examples:
Python 3 Nesting - If / For / While
Python 3 Nesting - If / For / While
Python 3 Nesting - If / For / While
Python 3 Nesting - If / For / While