For Loop is used when we know that how many time to repeat this loop to reach our goal .
Their concept is easier then the while loop.
-------------------------------------------------------------------
Syntax:
for variable in iterable:
statements
--------------------------------------------------------------------
Here i can explain the syntax of for loop with easy example with iterable range.
#range(starting value ,ending value ,step)
for variable in range(0,5,1):
print(variable)
output:
Output of range iterable |
2 Comments
Thanks bro
ReplyDeleteThat amazing 👏
ReplyDelete