Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python please!! Lab 5 B: The box Write a program that asks the user for a value. Based on the value given to the program

Python please!!
Lab5B: The box
Write a program that asks the user for a value. Based on the value given to the program by the user, use nested for-loops to draw a box that has the length and the width of the value specified by the user. Afterwards, use the same value and another pair of nested for-loops to draw a right-facing right-triangle. Finally, use a last pair of nested for-loops to draw a right-triangle facing the left. See the examples below for reference.
The user input is indicated in bold.
Sample Output #1:
Please enter a value for the size: 4
This is the requested 4x4 box:
****
****
****
****
This is the requested right-facing 4x4 right-triangle:
*
**
***
****
This is the requested left-facing 4x4 right-triangle:
*
**
***
****
Sample Output #2:
Please enter a value for the size: 5
This is the requested 5x5 box:
*****
*****
*****
*****
*****
This is the requested right-facing 5x5 right-triangle:
*
**
***
****
*****
This is the requested left-facing 5x5 right-triangle:
*
**
***
****
*****
Sample Output #3:
Please enter a value for the size: 8
This is the requested 8x8 box:
********
********
********
********
********
********
********
********
This is the requested right-facing 8x8 right-triangle:
*
**
***
****
*****
******
*******
********
This is the left-facing requested 8x8 right-triangle:
*
**
***
****
*****
******
*******
********

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

Relational Database Design A Practical Approach

Authors: Marilyn Campbell

1st Edition

1587193175, 978-1587193170

More Books

Students also viewed these Databases questions