Tuiton Loopsfhandling
Tuiton Loopsfhandling
Handling
REVISION IN DETAIL
1. for Loop:
The for loop in Python is used to iterate over
a sequence (such as a list, tuple, string,
etc.) or other iterable objects.
Loops
Iterations through range
for i in range(1, 5):
print(i)
The While loop
The while loop in Python repeatedly executes
a block of code as long as a specified
condition is True
count = 1
while count <= 5:
print(count)
count += 1
Control Statements in Loops: