Untitled
unknown
python
2 years ago
709 B
14
Indexable
import math
height = 7
width = 21
nosik = '.|.'
dash = '-'
center_line = math.ceil(height / 2)+1
middle_dashes = int((width - len('WELCOME'))/2)
for i in range(1, height+1, 2):
if i > center_line:
print(dash * middle_dashes, 'WELCOME', dash * middle_dashes)
else:
dash_count_one_side = int((width - i*len(nosik)) / 2)
nosiki_in_line = str(i * nosik)
print(dash * dash_count_one_side,
nosiki_in_line, dash * dash_count_one_side)
for i in range(center_line, 0, -2):
dash_count_one_side = int((width - i*len(nosik)) / 2)
nosiki_in_line = str(i * nosik)
print(dash * dash_count_one_side,
nosiki_in_line, dash * dash_count_one_side)Editor is loading...
Leave a Comment