Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In python, Explanations help! thanks. 1Write a function count Pos() that takes a two-dimensional list of integers as a parameter and returns the number of

image text in transcribedIn python, Explanations help! thanks.

1Write 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. The following shows several sample runs of the function Python 3.6.2 Shell File Edit She Debug Options Window Help >>>val - countPos([1, -1], [0, -3, 31, [12, 14, 16, 18]]) > val >>>countPos (Co], [0, 1], [0, 1, 2, 3],-5]1) 4 >>>countPos([0-1, -2, -3], [0], [-3, -2, -1], [0], [-3,-211 0 >>countPos(]) 0 Ln: 16 Col: 4 ile:/I/Users/bmaya/Documents/DePaul_Teaching/17-18_WQ/csc241 W2017Hws/assign7 html 1/3 /14/2018 Assignment 7 CSC 241-801 2. Write a function buildStrO that takes a two-dimensional list as a parameter and returns a string built from the strings found in the list. The list can contain any type of item. Recall that the typeO function can determine what type of object is currently stored in a variable and is helpful for this question. If the list is empty or the list contains no strings, the function should return the empty string. The following shows several sample runs of the function python 3.62 Shell File Edit Shel Debug Options Window Help >>> s = buildStr ( [ [ ' test' , 1, 2], [3 . 1415, ' Gertrude' , 'cat' ] , [5, 4, 3, 2, 1] , Prudence' ] ] ) >S 'testGertrudecat Prudence' >>> buildStr ( [ [ 1, 2, 3, 4, 5], [ ' Gertrude' ] , [ ' Thursday' , 3 . 5], [ ' YES ! ! ' , 1], [ "Booooo", 5, 35] ] ) Gertrude ThursdayYES! !Boooo0' >>>buildStr () >>> buildStr ([[1, 2], [3, 4], [5, 6], [7, 8], [9, 10], [11, 12]]) Ln: 25 Col: 4

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

Question

What is loss of bone density and strength as ?

Answered: 1 week ago

Question

The paleolithic age human life, short write up ?

Answered: 1 week ago