Bummer! This is just a preview. You need to be signed in with an account to view the entire instruction.
Well done!
You have completed (UPI) Chapter 7: Comprehensive Guide to Python Loops and Control Statements!
Instruction
Break and Continue Statement
Break Statement
A break statement
is used within a for
or a while
loop to allow the program execution to exit the loop once a given condition is triggered. A break statement
can be used to improve runtime efficiency when further loop execution is not required.
Example: A loop that looks for the character "a" in a given string called user_string
. The loop below is a regular ...