Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (47.6k points)

The definition of the continue statement is:

The continue statement continues with the next iteration of the loop.

I can't find any good examples of code.

Could someone suggest some simple cases where continue is necessary?

1 Answer

0 votes
by (106k points)

 You can see in the below-mentioned example how continue statement works:-

for letter in 'Django': 

if letter == 'D': 

continue 

printf("Current Letter: {letter}")

The output will be:

Current Letter: j 

Current Letter: a 

Current Letter: n 

Current Letter: g 

Current Letter: o

It continues to the next iteration of the loop.

To know more about this you can have a look at the following video tutorial:-


 

Related questions

0 votes
1 answer
asked Feb 4, 2021 in Python by Rekha (2.2k points)
0 votes
1 answer
asked Sep 17, 2019 in Python by Sammy (47.6k points)
0 votes
1 answer

Browse Categories

...