You are viewing a single comment's thread. Return to all comments →
def build_row(i, size): left = [chr(96 + size - k) for k in range(i + 1)] right = [chr(96 + size - k) for k in range(i - 1, -1, -1)] return "-".join(left + right).center(size * 4 - 3, "-") size = int(input()) rows = [build_row(i, size) for i in range(size)] print("\n".join(rows + rows[-2::-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 →