Monday, 9 August 2021

Even numbers between 1 to 10 using for loop

Following Python program will print even numbers between 1 to 10 using for loop. 

Expected Output: 2 4 6 8 10 


Program Code:

for i in range(2, 11, 2):
  print (i, end=" ")

Output of Program:

2 4 6 8 10


* * * * *


< Back to Python Loops >





No comments:

Post a Comment