Python pattern pyramid || Printing numbers in pyramid shape in python || how to print pyramid

Опубликовано: 21 Апрель 2026
на канале: CodeWithShivam
132
2

In this program you will see how to print pyramid pattern in python by using single loop.
This is very simple code. I hope you will be understood with this code.

n=int(input("Enter number of rows:"))
for i in range(n):
print((n-i-1)*' '+(2*i+1)*str(2*i+1))

n=int(input("Enter number of rows:"))
for i in range(n):
print((n-i-1)*' '+(2*i+1)*str(i+1))

To see the triangle in star shape :   • Python Pattern Programs || Printing Stars ...  

To see the star pattern :    • Python pattern program || Printing Stars '...  

To see right angle triangle in star shape :   • Python Pattern Programs = Printing Stars '...  

============================Tag==============================
some keywords for YouTube SEO :

python pattern tutorial
python pattern printing programs
python pattern printing
Python Tutorial for Beginners | Printing Patterns in Python
Python Pattern Program - Number Pattern (Printing Numbers in Pyramid Shape)
Python Pattern Programs - Printing Stars '*' in Pyramid Shape
Python Program Explained in Hindi
how to print pattern in python
how to print pattern by single loop

#Number_pattern
#pythonpattern
#CodeWithShivam