Question: ''' How do you create a function called countEven2D() to count even numbers from the function print2D(list) in python 3.6? I'm using visual studio community
''' How do you create a function called countEven2D() to count even numbers from the function print2D(list) in python 3.6? I'm using visual studio community 2017. This is what I have so far. ''' import random import math
def print2D(list): for row in range(0, 4): for col in range(0, 3): print(list[row][col],end = ' ') print('')
def countEven2D(b):
list = [[random.randint(0,25) for x in range(3)] for y in range(4)] # main() print2D(list)
OUTPUT: 22 25 15 10 24 23 8 0 18 19 21 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
