Page 119 - KEC Khaitan C8 Flipbook
P. 119

PROJECT NAME: Generate Patterns

                 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


                 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 asterisks required to align the
                              triangle

                             Print the spaces followed by the asterisks for each row.

                 Step  3   Output:

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


                                                     *
                                                     * *
                                                     * * *
                                                     * * * *




                  Code:

























                                                                                                 Hands-On Project  117
   114   115   116   117   118   119   120   121   122   123   124