Alphabet Rangoli

  • + 2 comments
    z = "abcdefghijklmnopqrstuvwxyz"
    		
    b = "".join(z[:n][::-1])
    	
    c = [b[0:i]+b[0:i+1][::-1] for i in range(n)]
        
    d = ["-".join(i).center(n*4-3,"-") for i in c]
    
    print("\n".join(d), "\n".join(d[::-1][1:]), sep="\n")