A for loop lets you repeat a block of code over a sequence—like a list, a string, or a range of numbers.
In Python, range(5) starts at 0 and stops before 5. This is Handy for when you need to loop a specific number of times.
You can use the else statement with a for loop. The else block runs when the loop finishes normally, and not if you break out of it.
#python #ai #datascience #machinelearning #forloop