Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a function count_pos that takes a two-dimensional list of integers as a parameter and returns the number of elements in the list that are

Write a function count_pos that takes a two-dimensional list of integers as a parameter and returns the number of elements in the list that are positive. If there are no positive numbers in the list, then the function should return 0.

>>> count_pos([[3, 6, -1], [4], [3, -5, 0]])

4

>>> count_pos([[-1, 0]])

0

use python 3.7.0)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions