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.
if you guies want a math, no list and pure logical then can reffer to this:
defprint_rangoli(size):# your code goes herep=96+sizea=(size-1)*2+1w=(size-1)*4+1foriinrange(a):ptrn=""ifi<size:itr=iv=p-ielse:itr=a-i-1v=p+i+1-aforjinrange(itr):ptrn+=chr(v-j+itr)+"-"ptrn+=chr(v)+ptrn[::-1]print(ptrn.center(w,"-"))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 →
if you guies want a math, no list and pure logical then can reffer to this: