CODING JOY

The stunning potpourri of coding and mundane life

SPLIT PYRAMID PATTERN IN PYTHON



AMRUHA AHMED
11th October,2023.



This article will aid you in the creation of a split pyramid pattern in Python using a combination of nested loops.

blog1

DELVING DEEPER:

BREAK-UP OF THE PATTERN:

blog1

PROGRAM:

                
                    s=7 #for spaces
                    for i in range (1,8):
                      for j in range(1,s):
                        print("  ",end="")
                      for j in range(1,i):
                        print("* ",end="")
                      print(" ",end="")
                      for j in range(1,i):
                        print("* ",end="")
                      print("\n")
                      s=s-1;
             
         
CODE COPIED

OUTPUT:

blog1