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.
- Prepare
- Python
- Strings
- Alphabet Rangoli
- Discussions
Alphabet Rangoli
Alphabet Rangoli
Sort by
recency
|
1370 Discussions
|
Please Login in order to post a comment
def print_rangoli(size): list2=[] for k in range(1,size+1): list1=[] for j in range(size-k,size): list1.append(chr(97+j)) if k==1: word1="-".join(list1[::-1])+"-".join(list1[1::]) else: word1="-".join(list1[::-1])+"-"+"-".join(list1[1::])
if name == 'main': n = int(input()) print_rangoli(n)