Python Loops
Python Loops
VKS-12
LOOPS
Iteration
VKS-12
VKS-12
For loops are traditionally used when you have a piece of code which
you want to repeat n number of times.
While Loop is used when a condition is to be met, or if you want a
piece of code to repeat forever,
VKS-12
Syntax
while(Condition) :
Python Statement(s)
Updating of control variable
range()
Function range() generates a list of numbers, which
is generally used to iterate over with for loop. Often
you will want to use this when you want to perform
an action for fixed number of times.