For loop in Python
A for loop is a tool in programming that makes it easy to
repeat a set of actions multiple times. Instead of writing the same code over
and over, you can use a for loop to repeat the actions for you, as
many times as you need. All you need to do is set a start, an end, and a way to
move from one repetition to the next.
Five main points about for
loops:
- Repeat a set of statements multiple times.
- Control the number of iterations.
- Save time by avoiding repetitive code.
- Essential tool in programming.
- Versatile and widely used in software development.
For Loop Code Syntax In Python
n = int(input("Enter Number for find factorial = "))
f=1
for i in range(1,n+1):
f=f*i
print(f"Factorial of {n} is {f}")
f=1
for i in range(1,n+1):
f=f*i
print(f"Factorial of {n} is {f}")
Video For Better Understanding👇👇👇
LIKE SHARE AND SUBSCRIBE