Python For Loop
In python there are two type of loop.
- For loop
- While loop
In this post we are going to explain for loop.
for loops are used when you have a block of code which you want to repeat a fixed number of times. The for-loop is always used in combination with an iterable object, like a list or a range. The Python for statement iterates over the members of a sequence in order, executing the block each time.
Note:Python for loop can be used when there are no size given of list and dict. For example:
We can also use to for loop to get items from lists.