The for loop is used to repeat a specific block of code which you want to repeat a fixed number of times. The for loop is a control flow statement that is used to repeatedly execute a group of statements as long as the condition is satisfied.
Syntax:
for variable_name in sequence :
body of loop
This program is a Python script that demonstrates the use of the for loop and the built-in range() function.
# For Loop in Python for i in range(0, 21, 2): print(i) for i in range(5): a=int(input("Enter a No : ")) b=int(input("Enter a No : ")) print(a+b)To download raw file Click Here
0 2 4 6 8 10 12 14 16 18 20 Enter a No : 3 Enter a No : 2 5 Enter a No : 2 Enter a No : 2 4 Enter a No : 3 Enter a No : 3 6 Enter a No : 3 Enter a No : 3 6 Enter a No : 3 Enter a No : 3 6
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions