Answered step by step
Verified Expert Solution
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 !
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: 28Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started