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
|
1357 Discussions
|
Please Login in order to post a comment
def print_rangoli(size): # your code goes here for x in range (96+size,96,-1): listcharsl = [chr(c) for c in range (96+size,x-1, -1)] listcharsr = [chr(c) for c in range (x+1,97+size)] print ("--"(x-97),"-".join(listcharsl), "-" if listcharsr else "", "-".join(listcharsr),"--"(x-97), sep="")
def print_rangoli(size): s,l='',[] if size==1: print('a') else: for i in range(96+size,96,-1): for j in range(96+size,i-1,-1): s=s+chr(j)+'-'
def print_rangoli(size): import string