def print_rangoli(n): # step 1 - store letters of the alphabet alphabet = "abcdefghijklmnopqrstuvwxyz" # step 2 - get the first n letters of the alphabet first_n = alphabet[:n] # step 3 - draw the middle line middle = "-".join(first_n[::-1] + first_n[1:]) # step 4 - get the length of the middle line length_of_middle = len(middle) # step 5 - draw upper half for i in range(1, n): print("-".join((first_n[n:n-i:-1] + first_n[n-i:n]).center(length_of_middle, "-")))