Question: 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: 28
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
