Question: ```
import random

import math

count = 0

def print2D(list) :

    for row in range(0, 4):
        for col in range(0, 3):
            print(list[row][col], end = ' ')
        print(' ')

list = [[random.randint(0, 5) for x in range(3)] for y in range(4)]

print2D(list)

```

This is my current code. I need to create an new function which finds and counts the even numbers in the list. The even numbers don't need to add up, I just need to count how many there are. I am new to Python and my lecture videos don't help to much. This is what I have tried so far is:

1)

```
count = 0

if list % 2 == 0 :

   count += 1

print(count)

```

*num being the list*

and 2) Splitting the list. The list is random so I wasn't sure how to split the list

Answer: 
This is one way using list comprehension: 

```
lst = [[random.randint(0, 5) for x in range(3)] for y in range(4)]
print(lst)
print(len([item for sublst in lst for item in sublst if item%2 == 0]))
# [[4, 3, 4], [4, 2, 2], [5, 3, 4], [5, 1, 1]]
# 6        

```

We form a list containing only even numbers from `lst`. Then, `len()` counts the number of items in that list.
```
import random
import math
def count(list):
  count = 0
  for row in range(0, 4):
    for col in range(0, 3):
        if list[row][col] % 2 == 0 :
            count+= 1
print('Total Even Numbers :',count)
print(list)

list = [[random.randint(0, 5) for x in range(3)] for y in range(4)]
count(list)

```

Output:Total Even Numbers : 4

[[3, 5, 0], [5, 1, 4], [4, 2, 3], [3, 1, 1]]