Python 3

Python For Loop Examples

We offen use loop statements for repeating statements. One of that statement is for loop.

Here is the syntax of for loop:

Offen use:

Simple example:

 

Python “For Loop” Examples

 

Example 1: Program to list numbers that are fully divisible from 1 to 100 by 3 or 5

 

 

Example 2: Program to list 100 from the number entered by the user

 

 

Example 3: Program the sum of the numbers between two numbers according to the specified step

 

 

Example 4: Calculate exponent of a number without using math.pow method in Python

 

 

 

 

 

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.