You are viewing a single comment's thread. Return to all comments →
def print_rangoli(size): x=[] for i in range(size,0,-1): l=[] for j in range(size,i-1,-1): l.append(chr((j-1)+97)) if len(l)>1: l=l+l[-2::-1] x.append(("-".join(l).center((2*(2*size-1)-1),'-'))) x=x+x[-2::-1] for b in x: print(b)
Seems like cookies are disabled on this browser, please enable them to open this website
I agree to HackerRank's Terms of Service and Privacy Policy.
Alphabet Rangoli
You are viewing a single comment's thread. Return to all comments →