Page 121 - KEC Khaitan C8 Flipbook
P. 121
PROJECT NAME: 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:
Hands-On Project 119

