Optimize an existing Python code snippet to print all even numbers between 1 and 10.
num = 1
while num<=10:
    print(num)
    num+=1
num = 0
while num<=10:
    if num % 2 == 0:
        print(num)
    num+=1