Answer to Question #257382 in Python for Isabel Cortez

Question #257382

5. Even Out

by CodeChum Admin


Instructions:

Input two integers in one line, separated by a space. The first integer shall represent the starting point, and the other, the ending point.

Print out all even numbers that are within the range of the starting and ending point (inclusive or including the ending point).


Instructions

Create two variables assigned with an input() function that will accept integer values. Note that the integer values will all be typed in one line separated by space, so remember how to do that with the past lessons on taking multiple inputs in one line.

Print out all even numbers that are within the range of the first and second inputted integers. You must also remember that the inputted integers are also included in evaluating if it's an even number so be careful in filling out your range() function for this one.


Input

A line containing two integers separated by a space.


5 10


Output

A line containing integers separated by a space.


6 8 10


1
Expert's answer
2021-10-27T05:43:03-0400
mn, mx = map(int, input().split())
if mn % 2:
    mn += 1
print(*range(mn, mx + 1, 2))

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS