google.com, pub-4617457846989927, DIRECT, f08c47fec0942fa0 Learn to enjoy every minute of your life.Only I can change my life.: Program in python to demonstrate star pattern after 180 degree rotation

Friday, December 27, 2019

Program in python to demonstrate star pattern after 180 degree rotation

Program in python to demonstrate star pattern after 180 degree rotation

Answer:

def pypart2(n):
   
 
    k = 2*n - 2

 
    for i in range(0, n):
   
            for j in range(0, k):
            print(end=" ")
   
     
        k = k - 2
   
            for j in range(0, i+1):
       
       
            print("* ", end="")
   
   
        print("\r")

n = 5
pypart2(n)

Output:

            *
         * *
      * * *
   * * * *
* * * * * 

No comments:

Post a Comment

शिव भोलेनाथ स्तुति

 जय शिवशंकर, जय गंगाधर, करुणा-कर करतार हरे,   जय कैलाशी, जय अविनाशी, सुखराशि, सुख-सार हरे जय शशि-शेखर, जय डमरू-धर जय-जय प्रेमागार हरे,   जय ...