Question

Write a program (Python Programming). When run, it should

  1. Ask the user to type a character
  2. Ask the user to type a number for the width
  3. Print a rectangle pattern based on the user-provided inputs
  • - The height of the rectangle is always 3 and refers to the number of lines
  • - The width of the rectangle refers to the number of characters and will always
  • be 2 or greater
  1. The exterior of the rectangle consists of the character that the user entered
  2. The interior of the triangle consists of spaces
  3. Print a message describing the rectangle that was printed as shown below

 

Enter a character: a

Width: 6

aaaaaa

a a

aaaaaa

"a" rectangle has a width of 6

 

Enter a character: 7

Width: 2

77

77

77

"7" rectangle has a width of 2

Expert Answer

Want to see the step-by-step answer?

Check out a sample Q&A here.

Want to see this answer and more?

Experts are waiting 24/7 to provide step-by-step solutions in as fast as 30 minutes!*

*Response times may vary by subject and question complexity. Median response time is 34 minutes for paid subscribers and may be longer for promotional offers.
Tagged in
Engineering
Computer Science

Python

Related Computer Science Q&A

Find answers to questions asked by students like you.

Q: Your analysis of Moen Corporation's fixed asset accounts at year end reveals the following informati...

A: Classified balance sheet : The main elements of balance sheet assets, liabilities, and stockholders'...

Q: The percent ionization of chloroacetic acid is less than that of fluoroacetic acid. —с—с—ӧ—н C -- Th...

A: The dissociation constant of a compound is defined by the ratio between the concentration of product...

Q: The first step in converting 30/50 = ?/200 to higher terms is to: Divide 200 by 50 Multiply 4 times...

A: Click to see the answer

Q: You deposit $400 in an account that pays 2.4% annual interest compounded monthly. a. When does your ...

A: Compound interest

Q: Match each description below with the following microscopic pictures. More than one picture may fit ...

A: Click to see the answer

Q: A ball is launched from (0, 0, 8) towards a target on the x-axis at (20, 0, 0). The initial velocity...

A: Click to see the answer

Q: Name the alkene. Be sure to indicate stereochemistry and use hyphens (-) not endashes (- H2C-CH3 H2C...

A: Name of the given hydrocarbon can be given according to IUPAC Nomenclature rules.

Q: 1. Two positive charges of 1 mC and 10 mC are separated by a distance of 10 m. Find the direction an...

A: Click to see the answer

Q: The rise of online streaming services such as Netflix and HBO Go has dramatically altered the media ...

A: Given: The contingency table with observed frequency count (O) is shown below     Age       18-...

Q: A highly collimated (parallel) beam of electrons is shot through a single slit of width 18.6μm. The ...

A: The de Broglie wavelength is given by  Where, h is the Plank's constant, m is the mass and v is the...

Q: . Standing by the side of a lonely highway at night, you see two motorcycle headlights, one in each ...

A: Standing by the side of a lonely highway at night, you see two motorcycle headlights, one in each di...

Q: Briefly describe ONE specific historical similarity between the women’s rights movement of the 1890s...

A: The women's rights movement in the late 19th and early 20th century expanded the issues from voting ...

Q: The figure shows some energy levels of hydrogen. If the magnitude of the elementary charge were 10e ...

A: Since energy of hydrogen atom is directly proportional to the 4th power of charge.

Q: 19 16 The box plot shows the number of home runs hit by 43 players during a baseball season. Which s...

A: Click to see the answer

Q: Which graph best represents a function with a range of all real numbers greater than or equal to 8?

A: For (a), Similarly, for (B) the range is (-∞,-8]. And the range of (C) is [8,∞).

Q: The energy required to ionize rubidium is 403 kJ/mol. What wavelength of light, in units of nm, is r...

A: We have to calculate the wavelength.   

Q: A child has a bottle full of pennies, nickels, dimes, and quarters. There are twice as many quarters...

A: Let p be number of pennies, n = number of nickels d = number of dimes q = number of quarters. Given ...

Q: The number of text messages sent and the number of phone calls made in a sample of 100 students

A: We know that the A variable that explains or affect the other variable is known as an explanatory va...

Q: When would you recommend merging accounts to a client?(Select all that apply)   A. If there are too...

A: When would you recommend merging accounts to a client?

Q: (b) Given that the boundary and initial conditions are as below: Boundary conditions: u(0,t) =u(1,t)...

A: Click to see the answer

Q: 4.16 LAB: Warm up: Drawing a right triangle This program will output a right triangle based on user ...

A: Required: i need help with this code and can you do it in python

Q: Each time Henry visits the art museum he pays $15 for parking and $25 for admission. If he buys a me...

A: Click to see the answer

Q: 5 An oil tanker crashes off the coast of Florida at 12: 00 pm (t oil spreads out over the surface of...

A: NOTE:- AS POSTED MULTIPLE QUESTIONS. WE HAVE ANSWERED FIRST THREE QUESTIONS FOR YOU.

Q: Madison has set up a lemonade stand outside her house and sells small cups and large cups of lemonad...

A: We can set up system of equations as below

Q: 6. A data analyst wants to save stakeholders time and effort when working with a Tableau dashboard. ...

A: Lets see the solution.

Q: Proteus mirabilis produces the enzyme urease, which converts urea into ammonia. If a patient has a u...

A: Kidneys are the organs belong to excretory system in our body and play a major role in several other...

Q: A student titrates 20.0 mL of 1.84 M HCl with a weak base (Kb = 2.33 x 10−6). The weak base and HCl ...

A: Given values: Volume (V1) of HCl = 20 mL Molarity (M1) of HCl = 1.84 M Kb = 2.33 × 10-6 Volume (V2) ...

Q: 10. Botswana and Etosha45 populations are on the same branch of the phylogenetic tree. Based on DNA ...

A: Phylogenetic tree is a graphic representation of the evolutionary relationship between different org...

Q: 1.21 LAB: Divide by x Write a program using integers user_num and x as input, and output user_num di...

A: user_num = int(input()) x = int(input()) for _ in range(3):     user_num = user_num//x     print(use...

Q: List the CPT code verified in the CPT Tabular List.  List the HCPCS code verified in the HCPCS Tabu...

A: CPT Code:    Current Procedural Terminology is the full form of CPT. These are numeric codes assigne...

Q: The standard definition of a quart is equal to 947 mL. Calculate the percent error of a student's m...

A: Given  Actual value of quart=947 mL The measured value of quart=938 mL Percent error has to be calcu...

Q: driver in a moving car applies the brakes. The car slows to a final speed of 1.70 m/s over a distanc...

A: This problem can be solved by using first and third equation of motion which is given as v = u + at ...

Q: 1. What is the empirical formula of naphthalene, C10H8? 2. The empirical formula of acetic is CH2O, ...

A: Since you have asked multiple questions we will solve the 1st three for you. If you want an answer t...

Q: 20. Amy drove to a friend's house at a rate of 45 mph. She returned by the same route at a rate of 5...

A: Topic- basic maths 

Q: 3.24-gram sample of NaHCO3 was completely decomposed in an experiment. 2NaHCO3 → Na2CO3 + H2CO3 In...

A: NaHCO3 is Sodium bicarbonate and it is also known as  as baking soda or bicarbonate of soda.  It is ...

Q: Development of Version 2.0 of a particular accounting software product is being considered by Jose​ ...

A: The critical path method is based on mathematical calculations to calculate the duration of the proj...

Q: The tip of a windshield wiper travels a distance of 31 inches in one 90 revolution. What is the leng...

A: Click to see the answer

Q: Cells manage to synthesize a variety of seemingly thermodynamically unfavored molecules every day. P...

A: In biological systems, the reactions are classified into endergonic reactions and exergonic reaction...

Q: The data to the right represent the top speed (in kilometers per hour) of all the players (except go...

A: A relative frequency distribution shows the proportion of the total number of observations associate...

Q: Mr. Clarke was admitted with bilateral renal calculi and has been receiving intravenous hydration an...

A: Actual renal failure occurs as a result of the deterioration of the function of the kidney. This lea...

Q: The famous iris dataset (the first sheet of the spreadsheet linked above) was first published in 193...

A: As we have the linear in the form, To solve "a" and "b", we have the two normal equations,

Q: What happens to a glass of pure fruit juice when water is added to it?

A: Molarity is defined as moles of solute per volume of solution in L. Molarity = Moles of solute (pure...

Q: Flynn is playing with a toy that is tied to his hand by a string. The toy falls toward the floor the...

A: Click to see the answer

Q: A list of numbers has n elements, indexed from 1 to n. The following algorithm is intended to displa...

A: Programs: Generally, programs contain the instructions to solve a problem. Any kind of complex probl...

Q: A system is being developed to help pet owners locate lost pets. Which of the following best describ...

A: Crowdsourcing is the practice of engaging a group for a common goal — often innovation, problem solv...

Q: 2a. Mia baked a very large apple pie that she cuts into slices to share with her friends. The smalle...

A: Click to see the answer

Q: a) How many electrons are necessary to produce a charge of -1.2 C? Express your answer using two sig...

A: Click to see the answer

Q: Scott Company had sales of $12,350,000 and related cost of goods sold of $7,500,000 for the year end...

A: (1) Adjusting entries are the Journal entries that are generally recorded at the end of an accountin...

Q: Drawing not to scale DH A E В C G F in the paper airplane shown, ABCD= EFGH, m/B=m/BCD = 90, and m/B...

A: Click to see the answer

Q: The symbol of a simple unprefixed SI unit has been left off of each measurement in the table below. ...

A: The international system of unit is the modern form of the metric system.