Python program that counts the number of even nonnegative values from a 2D list

Write a function that takes a 2D list; the function counts the number of even nonnegative values in each row, store it in a 1D list, and returns the list. Your program should print both, the 2D list and the 1D list returns by the function as shown below.

Sample output for 2D list [[2,3,5], [-8,4,6], [9,3,77], [11,-2,9]]

page1image63570752

list = [[ 2, 3, 5], [-8, 4, 6], [9, 3, 77], [11, -2, 9]]

def getEven(list):
     print(“2D list”)
     for row in list:
         for column in row:
             print(“{0:2d}”.format(column), end = ” “)
         print()
     print (‘\n'”Number of even non negative value”)
     for row in range (len(list)):
         print(“Row”, row+1,”:”, end = ” “)
         count = 0
         for column in range (len(list[row])):
             if (list[row][column] % 2 == 0 and list[row][column] > 0):
                 count += 1
         print(count)


getEven(list)

P