You are viewing a single comment's thread. Return to all comments →
size = 3 alphabets = [chr(i) for i in range(97,97+size)] alphabets.reverse() # print(alphabets) a = [alphabets[0]] for i in range(1,len(alphabets)+1): a.append('-'.join(alphabets[0:i])+'-'+'-'.join(alphabets[0:i+1][::-1])) # print("{}".format(a)+"->size = "+"{}".format(len(a))) s = 0 for i in range(size*2-2,0,-2): print('-'*i+a[s]+'-'*i) s += 1 print(a[s]) for _ in range(size-1): print('-'*i+a[s-1]+'-'*i) i += 2 s -= 1
Seems like cookies are disabled on this browser, please enable them to open this website
Alphabet Rangoli
You are viewing a single comment's thread. Return to all comments →