For Loops in Python
FOR LOOPs.
To perform some task repeatedly we used Loops statement. For Loops is one type of Loop in Python. For Loop is used to iterate over a given sequence, such as Lists, Dictionary or Strings. The code below prints "Hello Friends" for 10 times.
for i in range(10): print("Hello Friends")
In Python instead of using braces ({}), We use indentation to point the Loop Statements.
We look another example of For Loops.
for i in range(1,4): print("*" *i)
>>>Output >> *
**
***
Range function 👇👇👇
Range Function....
To perform some task repeatedly we used Loops statement. For Loops is one type of Loop in Python. For Loop is used to iterate over a given sequence, such as Lists, Dictionary or Strings.
The code below prints "Hello Friends" for 10 times.
for i in range(10):
In Python instead of using braces ({}), We use indentation to point the Loop Statements.
We look another example of For Loops.
for i in range(1,4):
>>>Output >> *
**
***
Range function 👇👇👇
Range Function....
Thank you..
ReplyDelete