Definition of for loop :
A for loop in Python is used to iterate over a sequence (like a list, tuple, or range) and execute a block of code for each item in that sequence.
Real time example of for loop:
Question 1:
Write a Python program using a for loop to print numbers between two inputs, excluding the start and end.
Program:
Output:
Question 2 :
Print Even Numbers Between 1 to 10
Program:
Output:
0 Comments