by CodeChum Admin
You know, I was lying when I said the last time that numbers associated with 3 are my favorite, because the one I actually like the most in the world are even numbers! But to make things harder for you, you have to pick the even numbers from a range of two given numbers. Ha!
Now, let's try this one more time!
Instructions:
Input
A line containing two integers separated by a space.
5·10
Output
A line containing integers separated by a space.
6·8·10
inputValues=input().split(' ')
number1=int(inputValues[0])
number2=int(inputValues[1])
if number2>number1:
for n in range(number1,number2+1):
if (int(n)%2==0):
print(n,end=" ")
else:
for n in range(number1,number2-1,-1):
if (int(n)%2==0):
print(n,end=" ")
Comments
Leave a comment