Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 102 - 2615_KEC
P. 102

    PROJECT 6: Generate Number Pattern

                      Software Used: Python Editor

                      Objective:
                      Develop a Python program to generate following patterns using looping statements.

                      Python Editors:

                      Pycharm (Desktop IDE)

                      Google Colab (Cloud-based platform, accessible via school email): https://colab.research.google.
                          com
                      Note: Ensure you log in with your school email ID for Colab access.

                      Step-by-Step Instructions: (Plan IPO)

                      Step  1   Input:

                                   Accept the number of rows for the triangle pattern (dynamic-varies with each user).

                      Step  2   Process:

                                   Use a loop to iterate through each row.

                                    For each row, calculate the number of spaces and numbers required to align the
                                   triangle
                                   Print the spac es followed by the numbers for each row.

                      Step  3   Output:

                                   Display a right-aligned triangle pattern of numbers. Refer to the sample:

                                                          1
                                                          1 2
                                                          1 2 3
                                                          1 2 3 4

                       Code:

                      100   Premium Edition-VIII

| 97 98 99 100 101 102 103 104 105 106 107 |