Ch5 Iterative Statement Q
Ch5 Iterative Statement Q
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).