CHAPTER-5: ITERATIVE STATEMENTS IN PYTHON
A. Fill in the blanks.
1. Expression
2. '+'
3. Iterative
4. Conditional
5. Colon
B. Write T for True and F for False.
1. False
2. True
3. True
4. True
5. True
6. False
C. Application-based questions.
1. Modulus Operator
2. If....else conditional construct
D. Select the correct option.
1. a) Looping
2. b) for
3. a) No output
4. c) in
5. a) while
E. Answer in one Word.
1. Infinite loop
2. for and while
3. in and not in
4. range() function
F. Answer the following questions.
1. Boolean operators are used to combine two or more conditional statements.
They
provide the result in the form of True or False. They are of three types: and, or,
and not.
2. The statements that keep repeating themselves as long as a given condition is
true are
called Iterative Statements. As soon as the condition becomes false, the loop
terminates. E.g. for <variable> in range (initial value, final value, stop)
Kips © Kips Learning Pvt. Ltd 2023
3. The ‘for’ and ‘while’ loops are called entry-controlled loops because the
condition
statement is checked in the beginning of the loop.
4. Membership operators play an important role in controlling the working of a
loop. There
are two membership operators, in and not in. The in operator is used with loops
to
check if a given value exists in the sequence or not
5. An infinite loop (or endless loop) is a sequence of instructions in a computer
program,
which loops endlessly. It happens either due to the loop having no terminating
condition
or the condition that can never be met.
6. The range() function used with the for loop in Python is helpful in generating a
sequence
of numbers in the form of a list. For example, range (10) will generate the
numbers from
0 to 9 (10 numbers).