In this article, we will learn to print all the even numbers in a range using the python program.
We will use for loop to do that.
Start = 4
End = 10
[4, 6, 8, 10]
- First, we will take input from users for starting and ending numbers.
- Then we will iterate for loop from start to end+1.
- After that, we will append all the even numbers to result in a list.
- Then we print the result.