fork download
  1. def printUpsideDownPyramid(rows):
  2. for i in range(rows, -1, -1): #For spaces
  3. for space in range(rows-i):
  4. print(" ", end="")
  5. for star in range(2*i-1): #For stars
  6. print("*", end="")
  7. print() #New row
  8.  
  9. printUpsideDownPyramid(9)
  10.  
Success #stdin #stdout 0.02s 8984KB
stdin
Standard input is empty
stdout
*****************
 ***************
  *************
   ***********
    *********
     *******
      *****
       ***
        *