Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 104 - 2615_KEC
P. 104

    PROJECT 7: Generate a Reversed Right-Angled Triangle

                      Software Used: Python Editor

                      Objective:
                      Develop a Python program to generate the reversed triangle 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 spaces followed by the numbers for each row.

                      Step  3   Output:

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

                                                          4 3 2 1
                                                          3 2 1
                                                          2 1
                                                          1

                       Code:

                      102   Premium Edition-VIII

| 99 100 101 102 103 104 105 106 107 108 109 |