Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python Pyramid Patterns half

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

k = 0

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