Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

for python 3 ! Write a function named random rects that asks a user how many rectangles they want and then prompts them for a

for python 3 !image text in transcribed

Write a function named random rects that asks a user how many rectangles they want and then prompts them for a width and height for each rectangle It then outputs all of the rectangles made of ascii stars and their combined area. The user will be guaranteed to input valid positive integers for each value when prompted The following calls demonstrate your function's behavior. Bold text is user input. Your function should match this output format exactly call random_rects() output How many rectangles? 3 How many rectangles? 4 random_rects() Width 1? 2 Height 1? 3 Width 1? 5 Height 1?2 Width 2? 4 Height 2? 2 Width 2? 3 Height 2? 2 Width 3? 3 Height 3?2 Width 3? 19 Height 3? 1 Width 4? 2 Height 4? 2 Total area: 22 Total area: 28

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

MySQL/PHP Database Applications

Authors: Brad Bulger, Jay Greenspan, David Wall

2nd Edition

0764549634, 9780764549632

More Books

Students also viewed these Databases questions

Question

a. What is the purpose of the team?

Answered: 1 week ago

Question

a. How are members selected to join the team?

Answered: 1 week ago