Star (*) Pyramid Pattern Using Python

CODE :

# Star (*) Pyramid using Python www.codewithcurious.com
def Pyramid(n):
 
 y = n - 1
 for i in range(0, n):
    for j in range(0, y):
       print(end=" ")
    y = y - 1
    for j in range(0, i+1):
 
       print("* ", end="")
    print("\r")
rows = 6
Pyramid(rows)

OUTPUT :

Leave a Comment

Your email address will not be published. Required fields are marked *