Even number?


#1

a = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13];
for number in a:
if number % 2 == 0
print number

I am getting a syntax error on the if statement. Why? I need it to print the even numbers in a.
THanks!


#2

The if statement requires a colon :.

    if number % 2 == 0:

#3

Also note that if you put and else statement in there to break then it also fails :frowning: when it shouldn't!!