ITERATIVE
STATEMENTS
IN PYTHON
Chap 4
Concept of Loop
• In a program, there are situations when we
have to repeat one or more statements
multiple times. This repetition can be carried
out using Loops in programming.
• The advantage of using the looping technique
in programming is that it reduces the number
of instructions and the usage of memory
space.
KRISH_INFO_TECH
Iterative Statements
The statements that keep repeating themselves as long as given condition is
True are called Iterative Statements or Repetitive Statements.
As soon as the condition becomes False, the loop terminates.
These statements are also called as Looping Statements or simply Loops.
KRISH_INFO_TECH
An iterative statement is based on three values:
A start value (initial A step value (increment
A test condition
value) or decrement)
Every loop works with the help of a variable known as
the Control variable.
KRISH_INFO_TECH
Types of Iterative Statements
KRISH_INFO_TECH
for Loop
• The for loop is used when we are sure about the number of
times a loop body will be executed.
• It is also known as a definite loop.
• The for loop in Python is used to iterate over the items of a
sequence in order, such as a list or a tuple for a fixed number
of times.
KRISH_INFO_TECH
While Loop
• The while loop is the simplest of all looping structures.
• This loop can be applied to a program where the number of
iteration is not known beforehand.
• The while loop keeps on executing the block of a statement
as long as the specified test condition evaluates to true.
KRISH_INFO_TECH