The Potency of else Block
Understand the scope of else block in detail.
We'll cover the following...
An unacknowledged feature
You may be startled to learn that the scope of the else
block exists beyond the if
statement. The else
clause also works with the for
, while
and try
statements.
Python follows a specific code of behavior when extending the else
scope. Let’s get acquainted with it before running a few examples. ...
Create a free account to view this lesson.
By signing up, you agree to Educative's Terms of Service and Privacy Policy