# Arup Guha
# 2/29/2020
# Program to accompany function notes for COP 2930

def main():

    # Get what the user wants.
    rows = int(input("How many carats do you want your diamond to be?\n"))
    ch = input("What character do you want to print it with?\n")

    # Print it!
    print("Here you go:\n")
    diamond(rows, ch)

# Prints myStr n times.
def printString(myStr, n):
    print(myStr*n, end="")

# Prints a top triangle (point at top) of numRows using the character ch,
# padding with leftSpaces # of spaces on the left.
def topTriangle(numRows, ch, leftSpaces):

    # Spaces for first row.
    spaces = numRows-1

    # Loop through each row, loop index equals # of stars for each row.
    for stars in range(1, 2*numRows, 2):

        # We do left spaces follows by regular spaces.
        printString(' ', leftSpaces)
        printString(' ', spaces)

        # Now we print our stars and go to the next line.
        printString(ch, stars)
        printString('\n', 1)

        # For next row!
        spaces -= 1

# Prints a bottom triangle (point at bottm) of numRows using the character ch,
# padding with leftSpaces # of spaces on the left.
def bottomTriangle(numRows, ch, leftSpaces):

    # Spaces for the first row.
    spaces = 0

    # Stars on each row, counting down.
    for stars in range(2*numRows-1, 0, -2):

        # We do left spaces follows by regular spaces.
        printString(' ', leftSpaces)
        printString(' ', spaces)

        # Now we print our stars and go to the next line.
        printString(ch, stars)
        printString('\n', 1)

        # For next row!
        spaces += 1

# Prints a diamond of carats number of carats using the character ch.
def diamond(carats, ch):

    topTriangle(carats, ch, 0)
    bottomTriangle(carats-1, ch, 1)

# Run it!
main()


