For loop in python is used to iterate over a iterable item such as list, strings etc.

For example Write Code As below in Python IDE or Anaconda

how to write for loop in python
For loop in Python

It will start count from Zero and goes to less than the values mentioned in range (value mentioned)

Example of For loop with list .List is very useful in Python. As shown

for loop with list
For loop With List

Example of For Loop with String. As shown below. Here c is string

for loop with string
For loop with string

 

By SC

One thought on “For loop in Python”

Leave a Reply

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