You are viewing a single comment's thread. Return to all comments →
from string import ascii_lowercase def print_rangoli(size): alphas = list(reversed(ascii_lowercase[:size])) for i in range(1, size+1): print("-".join(alphas[0:i] + \ list(reversed(alphas[0:i]))[1:]).center((size*2 -1)*2 - 1, "-")) for i in range(size-1, 0, -1 ): print("-".join(alphas[0:i] + \ list(reversed(alphas[0:i]))[1:]).center((size*2 -1)*2 - 1, "-"))
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 →