Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 108 - 2615_KEC
P. 108

    PROJECT 9: Generate A Pyramid Pattern

                      Software Used: Python Editor

                      Objective:
                      Develop a Python program to generate a pyramid of numbers using looping statements.

                      Platform:

                      PyCharm

                      Google Colab (Login with your school email ID): Colab Link

                      Step-by-Step Instructions

                      Plan IPO Framework:

                      Step  1   Input:

                                    Prompt the user to enter the number of rows for the pyramid (dynamic and varies for
                                   each user).

                      Step  2   Process:

                                   Use a loop to iterate through each row.

                                   For each row:

                                   o  Calculate the required number of spaces for alignment.
                                   o  Calculate the numbers to display in that row.

                                   Combine spaces and numbers to form the pyramid structure.

                      Step  3   Output:

                                   Display the pattern.

                                    Code:

                      106   Premium Edition-VIII

| 103 104 105 106 107 108 109 110 111 112 113 |