Control Flow and Looping


#1

this is my code

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

it says this
Oops, try again. Your code should have printed 0, but did not!


#2

you should have printed the even numbers in the list, you are not going to achieve this by with this condition:

if number > 13:

please take another look at the instructions


#3

it still not work???


#4

can you post an updated version of your code?


#5

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

it says this
Oops, try again. Your code should have printed 0, but did not!


#6

how is that condition going to find all the even numbers in the list? i recommend to use the modulo operator (%) since the remainder of a even number is zero, and of a odd number one.


#7

yay i got it thx for the help