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: 
one way is by using while, that takes the start and end range in

```
for each in range(int(input()),int(input())):
    while each%2 == 0:
       print (each)
       break; 

```
Try this:

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

```