1 write a function to generate and return a 2d array ie a


Python 3.5

1. Write a function to generate and return a 2D array (i.e. a two dimension list) filled with underscores "_" given the number of rows and the number of columns where the number of rows does not necessarily equal the number of columns. An empty array 3 x 5 array would look like:

_ _ _ _ _
_ _ _ _ _
_ _ _ _ _

Write a function to print a 2D array to the console with one space between items in a row given the array.

Write a function to fill in all cells on and below the left to right diagonal of an array given the array. The left to right diagonal always starts at (0,0). A filled cell in an array will be represented by a capital letter ( I choose my initial, Z, as my fill character). Output should be similar to the following; using the fill character of your choice. Some examples are:

Z _ _ _ _

Z Z _ _ _

Z Z Z _ _

Z Z Z Z _

Z Z Z Z Z

 

Z _ _ _ _

Z Z _ _ _

Z Z Z _ _

 

Z _ _

Z Z _

Z Z Z

Z Z Z

Z Z Z

The main program should prompt the user for the dimensions of the test arrays. Test the function by generating an empty array, filling the cells below the left to right diagonal and printing the array. 

Test with 3 arrays: one square array, one where there are more columns than rows, and one where there are more rows than columns; rows and columns must be a minimum of 3 for all test cases 

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: 1 write a function to generate and return a 2d array ie a
Reference No:- TGS01185843

Expected delivery within 24 Hours