Loops are an integral part of any language. Likewise for loops are an important part of Python. However there are a few things which most beginners do not know about them. We will discuss a few of them one-by-one.

Let’s first start off with what we know. We know that we can use for loops like this:

fruits = [ 'apple' , 'banana' , 'mango' ] for fruit in fruits : print ( fruit . capitalize ()) # Output: Apple # Banana # Mango

That is the very basic structure of a for loop. Now let’s move on to some of the lesser known features of for loops in Python.