Question: I have a homework to do in Python class and was given this question:

> 
> Make a program that gets 2 numbers from the user, and prints all even
>  numbers in the range of those 2 numbers, you can only use as many for
>  statements as you want, but can't use another loops or if statement.
> 
> 
> 

I understand that I need to use this code:

```
for num in range (x,y+1,2):
    print (num)

```

but without any `if` statements, I can't check if the value `x` inserted is even or odd, and if the user inserted the number `5` as `x`, all the prints will be odd numbers.

I also tried to enter each number to a tuple or an array, but I still can't check if the first number is even to start printing.

```
def printEvenFor(x,y):
    evenNumbers =[]
    for i in range (x,y+1):
        evenNumbers.append(i)
    print (evenNumbers[::2])

```

or

```
def printEvenFor(x,y):
    for i in range (x,y+1,2):
        print(i,",")

```

I expect the output of `printEvenFor(5,12)` to be `6,8,10,12` but it is `5,7,9,11`

Answer: 
You can use reminder to get the correct range:

```
def print_event_for(min_, max_):
    reminder = min_ % 2
    for i in range(min_+reminder, max_+reminder, 2):
        print(i)

print_event_for(5, 12)

```

Output:

```
6
8
10
12

```
```
def printEvenfor(x,y):
    return list(range(((x+1) // 2) * 2,y+1, 2))

printEvenfor(9,16)

```