Home python Why do you need Continue operator in Python?

Why do you need Continue operator in Python?

Author

Date

Category

really just to skip the number?

count = 1
While True:
   Count + = 1
   IF Count == 504:
     Continue.
   IF Count & GT; 520:
     Break
   PRINT (COUNT)

Answer 1, Authority 100%

The Continue statement in Python is designed to interrupt the current iteration of the cycle. For example:

for i in range (10):
   IF i in [1, 5, 6]:
     Continue.
   PRINT (I, END = "")

For this example, the output will be like this:
0 2 3 4 7 8 9

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions