STATEMENT FLOW CONTROL
In a program , statements may be executed sequentially , selectively or iteratively . Every programming language provides construct to support sequence , selection or iteration .
Sequence
The sequence construct means the statement are being executed in sequence .
Every python program starts with the first statement of program . Each statement in turn is executed in sequence . when the final statement of the program is executed , the program is done .
Sequence refers to the normal flow of control in a program and it is the simplest one .
Selection
The selection construct means the execution of statements depending upon a condition – test . if a condition evaluates to true , a course of action ( a set of statements ) is followed otherwise another set of action ( a different set of statement ) is followed . this selection construct is also called as decision construct because it helps in making decisions about the which the set of statements is to be executed .
Iteration ( looping )
The iteration construct means repetition of a set of statements depending upon a condition test , a set of statements are repeated again and again . as soon as the condition becomes true ( or false ) , the repetition stops .
The iteration construct is also called as looping construct .
Body of the loop
The set of statements that are repeated again and again is called as the body of the loop .
Exit Condition
The condition on which the execution or exit of the loop is depends Is called as the exit condition .
IMPORTANT QUESTIONS WITHOUT ANSWER
Q 1 – WHAT IS STATEMENT ?
Q 2 – HOW MANY TYPES OF STATEMENT ARE THERE IN PYTHON ?
Q 3 – WHAT IS COMPOUND STATEMENT
Q 4 – EXPLAIN THE THREE CONSTRUCTS OF PYTHON IN BRIEF
Q 5 – DEFINE THE THREE CONSTRUCTS OF PYTHON.
IF YOU VISIT OUR BLOG YOU CAN EASILY FIND THE ANSWERS OF THESE QUESTIONS
THANK YOU FOR VISITING KEEP VISITING
STATEMENT FLOW CONTROL
Reviewed by Learn Python
on
November 15, 2019
Rating:
No comments: