Flow of Control
Flow of Control
Storing conditions =
Sometimes the conditions being used in a code are complex and
repetitive.In such cases to make your program more readable, you
can use named conditions where you can store conditions in a name
and then use that named conditional in the if statements.
Range = (starting value, ending value {required value -1 },step value)
Iteration statements are also known as looping statements.
If the condition is test before executing the loop-body, i.e., before
entering in the loop, the loop is called entry-controlled loop or pre-
condition loop.
If the condition is tested after executing the loop-body at least
once, it is called exit-controlled loop or post-condition loop.
For loop =
for <variable> in < sequence> :
statements_to repeat
While loop =
while < logical expression> :
loop-body
Break statement =
The break statement enables a program to skip over a part of the
code.
The break statement terminates the very loop it lies within.