Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a function that returns 2 dimensional array of zeros with its size specified in the function arguments. The two arguments should be name, explicitly,

image text in transcribed

Write a function that returns 2 dimensional array of zeros with its size specified in the function arguments. The two arguments should be name, explicitly, rows and cols as they will be used when calling the function. You can assume that the passed values for the rows and columns will be always greater than 0. Here, you'll write a function which: - is named generate_2d. - takes 2 arguments, named: rows for the rows number in the array and for the columns number. - returns: 2 dimensional array. You should use regular Python lists and you are not allowed to use NumPy for this question. 59]: \# Solution goes here 60]: res = generate_2d (2,3) assert res ==[[0,0,0],[0,0,0], NameError Traceback (most recent call last) Cell In [60], line 1 >1 res = generate 2d(2,3) 2 assert res ==[[0,0,0],[0,0,0], NameError: name 'generate_2d' is not defined 61]: res = generate_ 2d(5,2) assert res =[[0,0],,[0,0],,[0,0],,[0,0],,[0,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

Database Concepts

Authors: David Kroenke, David Auer, Scott Vandenberg, Robert Yoder

9th Edition

0135188148, 978-0135188149, 9781642087611

More Books

Students also viewed these Databases questions

Question

1. Signs and symbols of the map Briefly by box ?

Answered: 1 week ago

Question

Types of physical Maps?

Answered: 1 week ago

Question

Explain Intermediate term financing in detail.

Answered: 1 week ago

Question

3. Discuss the process of behavior modeling training.

Answered: 1 week ago