Break, Continue, & Pass Statement in Python

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

Uses for pass

when drafting structure of code......

when do we use break, continue, or pass statements

to control the flow of loops

Use cases

When you want to stop the loop as soon as a specific condition is met

Continue Statement

continue is used to skip the rest of the current iteration and move directly to the next iteration of the loop

break, continue, and/or pass

control flow statements

Pass

Acts as a placeholder and does nothing- allows you to maintain the structure of your code without having any operational statements

break

used to exit out of the enclosing loop (either for or while loop)

Continue Uses

when you want to avoid executing certain parts of the loop for specific conditions, but not the whole loop


Kaugnay na mga set ng pag-aaral

Starting Out with Python Chapter 7

View Set

Peds Test 1 (Ch. 1, 3, 4, 5, 10, 12, 13, 15, 17, 19, 20, 21, 22, & 23)

View Set

The Rational Roots Theorem Assignment

View Set

Career Exam One - Ability and Aptitude Assessment in Career Counseling

View Set

Computer Programming Chapter 4 Review

View Set