Control Flow and Looping


#1



https://www.codecademy.com/courses/python-beginner-en-IZ9Ra/0/3?curriculum_id=4f89dab3d788890003000096#


Oops, try again. Your code looks a bit off. Check the Hint if you need help! Your code threw the following error: invalid syntax (python, line 4)


Replace this line with your code. 
a = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]

for key in a:
    if  a % 2 == 0:
        print a
print("PRINT A")


#2

Dont worry figured it out myself :slight_smile:
a = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]

for key in a:
if key % 2 == 0:
print key
else:
pass
correct code for anyone that needs the help :grinning:


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.