Pyramid

Write a program to print a pyramid

def pyramid(rows):

    # For spaces
    k = rows

    # Outerloop for number of rows
    for i in range(0, rows): 
        # Innerloop for spaces
        for _ in range(0, k):
            print(end=' ')

        k = k-1

        # Inner loop to handle the values
        for j in range(0, i+1):
            print('*', end=' ')
        print('\r')
pyramid(8)
        * 
       * * 
      * * * 
     * * * * 
    * * * * * 
   * * * * * * 
  * * * * * * * 
 * * * * * * * *