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

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

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