Start learning free

LESSON 156 OF 673 · LOOPS & CONDITIONALS

Even Numbers From List: Buggy Code in Python

Practice

Inside the code editor we've tried to write a function that takes a list nums as argument and prints to the console the even numbers from that list.

So when we called print_even_numbers([2, 1, 0, 4, 3]), we expected our code to print:

2
0
4

but it seems like we made some mistakes because when we run our code, it prints:

even
even

Assignment:

Your task is to fix our function such that it prints the even numbers from the list.

STEP 1 OF 1
    Ctrl + Enter to check