Table of Contents
In this tutorial, we will discuss the concept of while loop with continue, break and pass.
While loop aids with repeating tasks in an efficient manner.
In python, pass, continue and break statements can be used in while loops.
We can use the pass statement to write empty loops. Pass is also used to empty control loops, function and classes. The pass statements is a null operation, nothing happens while it executes.
Program 1
When the above code is executed, it produces the following results
No error massage and no output
When the above code is executed, it produces the following results
0
1
2
3
4
5
program 3
When the above code is executed, it produces the following results
var is==3
The continue statement is used in a loop to take the control to the top of the loop without executing the rest of the statements inside the loop.
program 1
When the above code is executed, it produces the following results
No error and no output
Program 3
When the above code is executed, it produces the following results
1 2 4 5 6 7 8
When the above code is executed, it produces the following results
No error and no output
Program 3
When the above code is executed, it produces the following results
1 2 3
Similar post
for loop with pass break continue statements
Multiply two numbers in Java using scanner| 5 different ways In this article, we will…
5 Different ways to Divide two numbers in Java using scanner In this article, we…
Learn 8 Ways to Subtract Two Numbers Using Methods in Java In this article, we…
10 ways to subtract two numbers in Java In this article, we will discuss the…
Java Code Examples – Multiply Two Numbers in 5 Easy Ways In this article, we…
How to Divide two numbers in Java| 5 different ways In this article, we will…
This website uses cookies.