You are currently viewing For loop in C vs Python | Basics of For loop
For loop in c

For loop in C vs Python | Basics of For loop

Spread the love

The looping simplifies complex programming logics to simple ones. Instead of writing the same code again and again with the help of for loop we can repeat the same code for a finite numbers of times.

Advantages of Loops:

  1. Code re-usability possible
  2. We do not need to write the same code again and again
  3. We can Traverse over the elements of data structure

There are following loop supported by python

  1. for loop
  2. while loop
  3. do_while loop

For loop in python

  • For loop is used in case where we need to execute some part of the code until the given condition is satisfied
  • It is also called pre-tested loops
  • It is better to use for loop if the number of iteration is known in advanced.

Syntax and python for loop codes

for interating_var in sequence:
for i in list:

For loop in c

Syntax and c program for loop

For loop in c
int i,n,c;
int main()
    printf("Enter the number");
        return 0;


In this article we saw basics of for loop in c vs python so about this article if any query then free to contact me.

sachin Pagar

I am Mr. Sachin pagar Embedded software engineer, the founder of Sach Educational Support(Pythonslearning), a Passionate Educational Blogger and Author, who love to share the informative content on educational resources.

Leave a Reply