You are viewing a single comment's thread. Return to all comments →
from math import floor def design_mat(height): mat = '' thread = '-' pattern = '.|.' width = 3*height mid = floor(height/2) for i in range(height): if i != mid: step = 2*(mid-abs(mid-i))+1 content = step*pattern step *= len(pattern) else: content = 'WELCOME' step = len(content) wrppr_str = ((width-step)//2)*thread line = wrppr_str+content+wrppr_str mat += line+'\n' print(mat) h = list(input().split()) design_mat(int(h[0]))``
Seems like cookies are disabled on this browser, please enable them to open this website
Designer Door Mat
You are viewing a single comment's thread. Return to all comments →