Write a function to generate and return a 2d array

Assignment Help Basic Computer Science
Reference no: EM13892630

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 

Reference no: EM13892630

Questions Cloud

Unadjusted trial balance and information for the accounting : 1.The unadjusted trial balance and information for the accounting adjustments of Noseworthy Investigators follow.
What would be the best way for an electrical : What would be the best way for an electrical engineer to enter the automotive industry?
What is the difference between inputstream and filereader : WHat is the difference between InputStream and FileReader?
Identify the target population and developmental stage : Identify the target population and developmental stage of the population, as well as the intended program track. (These will be elaborated upon further in the Program Narrative and Procedures section of the proposal.)
Write a function to generate and return a 2d array : 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..
Whom and for whom is an administrator responsible : Briefly describe a scenario in which an administrator's legal and ethical responsibilities might conflict, and moral courage is needed. What would you do in that situation, and why?
Write a term paper about the stroop test of working memory : Write a term paper about "The Stroop Test of working memory".
Prepare a business plan for tawseel l.l.c company : You need to prepare a business plan for Tawseel L.L.C Company -  Short-term Business Objectives.
Opening feature involving arynetta floyzelle : 1.Review this chapter's opening feature involving Arynetta Floyzelle and her Girl Team Mobile business.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Determine the range

then performs the following analysis on the numbers: Determine the average number Determine the maximum number Determine the range (maximum - minimum) Displays a histogram that shows the numbers in each five-unit range

  Draw a hierarchy diagram

Draw a hierarchy diagram (be sure to include Attributes and Methods)

  What does n-tier architecture mean

What does N-tier architecture mean? Describe the purpose of the Presentation Layer, Business Layer, and Data Layer

  Possibility-using fiber optic cable instead of twisted pair

Discuss the possibility of using fiber optic cable instead of either twisted pair cable or staying with the existing coax wiring structure.

  Write an update statement to change the phone number

Write an UPDATE statement to change the phone number of employee with EmployeeNumber 11 to 360-287-8810. Run this SQL statement.

  Write analogous steps in dimensioning computer network

Write four steps which you think a transportation engineer takes when dimensioning such highway. What are the analogous steps in dimensioning computer network?

  How would this ip address be expressed

How many possible hosts would there be on the above network if all usable addresses were assigned (show your work)? d. How would this IP address be expressed using CIDR notation (show your work)? e. What is the range of the block of addresses this..

  A contractor speaking to a potential client

1) How would you, as a contractor speaking to a potential client, handle this situation? Often times you can explain something to someone and they still not really understand. When a potential client asks a question such as this, they want to underst..

  Calculate the final score and report the results

Given a file with the results from a game of bowling, calculate the final score and report the results to an output file. I do not have to control bad input from file and all numbers will be legal to the game of bowling.

  Mechanism that supports process dispatching

The X25-Demodulator machine does not provide a mechanism for interrupts; any process in the X25 OS is non-preemptive. In addition, the OS does not provide a means for selecting the next job to run. Provide the design and justification for your..

  Operate an apache-based linux web server

29. Asume you operate an Apache-based Linux Web server that hosts your company's e-commerce site. Assume further that there is a worm called "WorminatorX," which exploits a (fictional) buffer overflow bug in the Apache Web server package that can res..

  Discuss three elements of managerial work-one function

Discuss three elements of managerial work-one function, one role and one skill-and describe how IT improves the manager's performance of each element.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd