3. What are control statements in Python? Mention types of control statements.
Answers
Answer:
Software Testing Help logo 1
Python Control Statements (Python Continue, Break and Pass)
Control Statements In Python
Python Control Statements with Examples: Python Continue, Break and Pass
In this Interesting Python Training Series, we learned about Looping in Python in detail in our previous tutorial.
This tutorial will explain about the various types of control statements in Python with a brief description, syntax and simple examples for your easy understanding.
What You Will Learn:
Watch the VIDEO Tutorial
Control Statements in Python
#1) Continue Statement:
#2) Break Statement:
#3) Pass Statement:
Recommended Reading
Watch the VIDEO Tutorial
Control Statements in Python:
Control Statements in Python
Control statements in python are used to control the order of execution of the program based on the values and logic.
Python provides us with 3 types of Control Statements:
Continue
Break
Pass
#1) Continue Statement:
When the program encounters continue statement, it will skip the statements which are present after the continue statement inside the loop and proceed with the next iterations.
2) Break Statement:
The break statement is used to terminate the loop containing it, the control of the program will come out of that loop.
#3) Pass Statement:
Pass statement is python is a null operation, which is used when the statement is required syntactically.