# Arup Guha
# 6/13/2023
# Some Nested Loop Designs

def numTri():

    n = int(input("Enter a positive integer less than 10.\n"))

    # i is # of values on the row.
    for i in range(1,n+1):

        # Prints numbers 1 through i.
        for j in range(1,i+1):
            print(j, end="")

        # Go to next row.
        print()

def numTri2():

    n = int(input("Enter a positive integer less than 10.\n"))

    # i is # of values on the row.
    for i in range(1,n+1):

        # Prints numbers 1 through i.
        for j in range(1,i+1):
            print(i , end="")

        # Go to next row.
        print()

def backNumTri():

    n = int(input("Enter a positive integer less than 10.\n"))


    # i is what row we're on.
    for i in range(1, n+1):

        # Prints n-i spaces.
        for j in range(n-i):
            print(" ", end="")

        # Prints countdown from i to 1.
        for j in range(i, 0, -1):
            print(j, end="")

        # Advance to next line.
        print()

def backNumTriAlt():

    n = int(input("Enter a positive integer less than 10.\n"))


    # i is what row we're on.
    for i in range(1, n+1):

        # Prints countdown from i to 1.
        for j in range(n, 0, -1):

            # We must decide to either print ' ' or j...
            if j > i:
                print(" ", end="")
            else:
                print(j, end="")

        # Advance to next line.
        print()

def otherNumTri():

    n = int(input("Enter a positive integer less than 10.\n"))


    # Row numbers are backwards this time.
    for i in range(n, 0, -1):

        # Printing i, exactly i times.
        for j in range(i):
            print(i, end="")

        # Go to next line.
        print()
    
def pyramid():

    n = int(input("Enter a positive integer less than 80.\n"))

    numStars = 1

    # Count down from n-1 to 0, inclusive.
    for i in range(n-1,-1,-1):

        # Print i spaces.
        for j in range(i):
            print(" ", end="")

        # Print numStars stars.
        for j in range(numStars):
            print("*", end="")

        # Update for next row
        numStars += 2

        # Print to go to next line.
        print()

# Call whichever function you want to test here.
pyramid()

            
