Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python Pyramid Patterns half

rows = int(input("Enter number of rows: "))

for i in range(rows, 1, -1):
    for space in range(0, rows-i):
        print("  ", end="")
    for j in range(i, 2*i-1):
        print("* ", end="")
    for j in range(1, i-1):
        print("* ", end="")
    print()
Source by www.programiz.com #
 
PREVIOUS NEXT
Tagged: #python #Pyramid #Patterns
ADD COMMENT
Topic
Name
7+1 =