You are viewing a single comment's thread. Return to all comments →
def print_rangoli(size): alphabet ="abcdefghijklmnopqrstuvwxyz" alphabet = [char for char in alphabet] a1 = alphabet[:size]
indices = list(range(size)) reverse = indices[::-1] indice3 = indices + reverse[1:] for i in indice3: start_index = i+1 original = a1[-start_index:] reverse = original[::-1] row = reverse + original[1:] row = "-".join(row) width= size *4-3 row12 = row.center(width,"-") print(row12)
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 →
def print_rangoli(size): alphabet ="abcdefghijklmnopqrstuvwxyz" alphabet = [char for char in alphabet] a1 = alphabet[:size]