Scripting >> Examples >> Python-Perl-Powershell-Bash-Windows Batch >> Example 003 - How to perform for loop with a loop iteration counter


To perform an iteration using a for loop.


Examples in Python, Perl, Powershell, Bash and Windows batch.
 

 

 

 

 

 

 

 

 

 

 

 

 

## NOTES:
## 1. In Python, the range(start,stop,step) function, generates a list of integers
## from start, to stop-step, in increments of step
## so range(1,6,1) generates 1,2,3,4,5
##
## END ##

 

Sample output - Python

 

Sample output - Perl


 

 

Sample output - Powershell

 

 

Sample output - Bash

 

 

Sample output - Windows batch