You are viewing a single comment's thread. Return to all comments →
def print_rangoli(size): y = [chr(97+i) for i in range(26)] inp = size for i in range(2*inp-1): temp = [y[abs(inp - 1 - i) + abs(inp - 1 - j)] if (abs(inp - 1 - j) + abs(inp - 1 - i))<= (inp - 1) else '-' for j in range(2*inp-1)] print('-'.join(temp)) if __name__ == '__main__': n = int(input()) print_rangoli(n)
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 →