Complete Guide to Python Loops
There are two loop statments in python.
- while
- for-in
while
- Print the sequence 1, 5, 13, 29, … 8189.
for-in
- Print the sequence 3, 7, 11, 15, … 99.
Interview Questions
1. What are the three python keywords related to python loops?
- break
- continue
- else
2. When will else-block be excuted in a loop?
when no break occurs.