You are viewing a single comment's thread. Return to all comments →
def print_rangoli(size): hyphen = '-' final_list = [] for i in range(size, 0 , -1): temp = [chr(96 + j) for j in range(size,i-1,-1)] alphabets = temp + temp[-2::-1] final_list.append(str((hyphen *((i -1) * 2))+"-".join(alphabets)+(hyphen *((i -1) * 2)))) print(*final_list, sep = "\n") print(*final_list[-2::-1], sep = "\n")
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 →