You are viewing a single comment's thread. Return to all comments →
my code is worst, i begin hate the string's challenges
def print_rangoli(size): abcd = "abcdefghijklmnopqrstuvwxyz" width = size + size-1 + (size-1)*2 n = 0 k = 2 m = 4 repeter = 1 _i = 0 _k = 1 for i in range(0,size*2-1): j = 0 while j < width: if j == round((width/2))-n: b = 1 c = 1 for l in range(repeter): if l % 2 == 0: print(abcd[size-b],end="") if c < _i+1: b += 1 else: b -= 1 c += 1 else: print("-",end="") j += repeter-1 else: print("-",end="") j += 1 if i == size-1: k = -2 m = -4 _k = -1 n += k repeter += m else: n += k repeter += m print("") _i += _k
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 →
my code is worst, i begin hate the string's challenges