Tools, FAQ, Tutorials:
'continue' Statement in Repeating Statement Blocks
How to use the "continue" statement in a repeating statement block in Python code?
✍: FYIcenter.com
The "continue" statement can be used in a repeating statement block like "for" and "while" loops to continue with the next looping item immediately.
When a "continue" statement is interpreted, Python will skip the rest of the statement block of the nearest "for" or "while" loop, and continue with its next iteration.
For example:
>>> for num in range(2, 10): ... if num % 2 == 0: ... print("Found an even number "+str(num)) ... continue ... print("Found a number "+str(num)) ... Found an even number 2 Found a number 3 Found an even number 4 Found a number 5 Found an even number 6 Found a number 7 Found an even number 8 Found a number 9
⇒ 'pass' - Do Nothing Statements
⇐ 'break' Statement in Repeating Statement Blocks
2017-09-12, 1325🔥, 0💬
Popular Posts:
How to include additional claims in Azure AD v2.0 id_tokens? If you want to include additional claim...
How to add an API to an API product for internal testing on the Publisher Portal of an Azure API Man...
Where to get a JSON.stringify() Example Code in JavaScript? Here is a good JSON.stringify() example ...
FYIcenter JSON Validator and Formatter is an online tool that checks for syntax errors of JSON text ...
How to use the XML to JSON Conversion Tool at freeformatter.com? If you want to try the XML to JSON ...