Using For loop in Python

A for loop is used to perform repititve tasks such as iterating over a list and doing some operation on each item in list.

The above example iterates over each item in fruits list.

break keyword will stop the for loop iteration at that point and skip rest of the iterations.

continue keyword will skip the current iteration and go on with remaining iterations.

Leave a Reply

Your email address will not be published. Required fields are marked *