Posts

Showing posts with the label Alphabet Rangoli

Challenge - #24 - Alphabet Rangoli

import  string def  print_rangoli(size):      # your code goes here     characters = string.ascii_lowercase     lst = []     width  =  4  * size  -3      for  i  in   range (size):         s =  '-' .join(characters[i:size])         lst.append((s[:: -1 ] + s[ 1 :]).center(width, '-' ))      print ( '\n' .join(lst[: 0 : -1 ] + lst)) if  __name__ ==  '__main__' :     n =  int ( input ())     print_rangoli(n)