Question: Lab: Number Pyramids Description Write a program in Python that builds a number pyramid based on a given height. Name your file number _ (

Lab: Number Pyramids
Description
Write a program in Python that builds a number pyramid based on a given height.
Name your file "number_(p)yramid.py". Be sure that your output matches the example format exactly, including any spacing and punctuation.
Bonus (+10)
Modify the program to create an inverted pyramid below the original, as shown in the bonus output.
Example runs:
Enter the height of the pyramid: 21123
Enter the height of the pyramid: 41123123451234567
Bonus:
Enter the height of the pyramid: 41123123451234567123451231
Planning Tips
You will need an outer loop to go through the rows, and two inner loops:
The first will print padding spaces, ''. Note that each row has total rows - current row spaces padding the start...The second will print the numbers for the current row. Note that each row has row *2-1 numbers in it...
Remember that you can specify the end parameter for the print function so that it does not create a newline by passing in an end='' argument. Lab: Number Pyramids
Description
Write a program in Python that builds a number pyramid based on a given height.
Name your file "number_pyramid.py". Be sure that your output matches the example format exactly, including any spacing and punctuation.
Bonus (+10)
Modify the program to create an inverted pyramid below the original, as shown in the bonus output.
Example runs:
```
Enter the height of the pyramid: 2
1
123
Enter the height of the pyramid: 4
1
123
12345
1234567
```
Bonus:
Enter the height of the pyramid: 4
1
123
12345
1234567
12345
123
1
Lab: Number Pyramids Description Write a program

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!