python program to display all the even numbers up to a user specific integer n
Answers
Answered by
12
Answer:
Given starting and end points, write a Python program to print all even numbers in that given range.
Example:
Input: start = 4, end = 15
Output: 4, 6, 8, 10, 12, 14
Input: start = 8, end = 11
Output: 8, 10
Example #1: Print all even numbers from given list using for loop
Define start and end limit of range. Iterate from start till the range in the list using for loop and check if num % 2 == 0. If the condition satisfies, then only print the number.
hope it helps..!!
Similar questions