We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
defprint_rangoli(size):# your code goes hereasciiVal=size+96change=-1char=""op=[]defmakeSymmetric(s):returns+s[:-1][::-1]foriinrange(size):char=char+chr(asciiVal)asciiVal=asciiVal+changeop.append(makeSymmetric("-".join(list(str(char)))).center(size*4-3,"-"))foriinop:print(i)foriinrange(len(op)-2,-1,-1):print(op[i])if__name__=='__main__':n=int(input())print_rangoli(n)
Cookie support is required to access HackerRank
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 →