Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python (.py file) Note: Please comment the steps and post a screenshot of your output, source code, and trials. Also include the spaces, indents, and

Python (.py file)

Note: Please comment the steps and post a screenshot of your output, source code, and trials. Also include the spaces, indents, and new lines. Thank you.

image text in transcribedimage text in transcribedimage text in transcribed

Part 3: Triangles and Diamonds 3A. Write a program that creates a pyramid out of asterisks using only while loops. Note, your program should allow the user to adjust the size of the pyramid. Please note, the minimum size of a pyrmaid is 2, Your program should terminate when the user enters to quit the program. Below is a sample run of your program: RESTART Instructions: This program prompts the user to enter the size of their pyramid Note, the size is the number of rows that make up the pyramid. The program will continuously prompt the user create a new pyramid until he or she enters g" to quit the program. Enter the size of the the pyramid: 1 Error: Your pyramid must be greater than size 1 Enter the size of the next pyramid: 3 k * Enter the size of the next pyramid: 4 k * Enter the size of the next pyramid: 6 k * Enter the size of the next pyramid: q You will now exit the program. Goodbye! 3B. Write a program that creates an inverted pyramid out of asterisks using only while loops. Note, your program should allow the user to adjust the size of the inverted pyramid. Please note, the minimum size of an inverted pyrmaid is 2. Your program should terminate when the user enters 'q' to quit the program. Below is a sample run of your program RESTART Instructions: This program prompts the user to enter the size of their inverted pyramid. Note, the size is the number of rows that make up the inverted pyramid The program will continuously prompt the user create a new pyramid until he or she enters q to quit the program Enter the size of the inverted pyramid: 1 Error: Your inverted pyramid must be greater than size 1 Enter the size of the next inverted pyramid: 3 k * Enter the size of the next inverted pyramid: 4 k x Enter the size of the next inverted pyramid: 6 Enter the size of the next inverted pyramid: q You will now exit the program. Goodbye! 3C. Write a program that creates a diamond out of asterisks using only while loops. Your program should allow the user to adjust the size of the diamond. Please note that the minimum size of a diamond is 2, Your program should terminate when the user enters to quit the program. Below is a sample run of your program: >RESTART Enter the size of the diamond: 7 Enter the size of the next diamond: 5 Enter the size of the next diamond: 3 k a Enter the size of the next diamond: 2 Enter the size of the next diamond: 1 Error: Your diamond must be greater than size 1. Enter the size of the next diamond: q You will now exit the program. Goodb

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

Excel As Your Database

Authors: Paul Cornell

1st Edition

1590597516, 978-1590597514

More Books

Students also viewed these Databases questions

Question

2. Identify the purpose of your speech

Answered: 1 week ago