𝕬
Size: a a a
𝕬
БГ
py3
s = """
****
* *
****
"""
print(s)
****
* *
****
БГ
RC
E
AT
def frame(width, height, symbol='*', space=' '):
horizontal = symbol * width
middle = [symbol + space * (width - 2) + symbol] * (height - 2)
return '\n'.join([horizontal] + middle + [horizontal])
E
def frame(width, height, symbol='*', space=' '):
horizontal = symbol * width
middle = [symbol + space * (width - 2) + symbol] * (height - 2)
return '\n'.join([horizontal] + middle + [horizontal])
AT
E
f
RC
БГ
def get_rectangle(height=2, width=2, char="*", fillchar=" ", newline="\n"):
if width<2 or heigh<2:
raise ValueError("Incorrect rectangle size")
outer = char*width
inner = "{}{}{}".format(
char, fillchar*(width-2), char
)
rectangle = newline.join((outer, inner*(height-2), outer))
return rectangle
AT
def get_rectangle(height=2, width=2, char="*", fillchar=" ", newline="\n"):
if width<2 or heigh<2:
raise ValueError("Incorrect rectangle size")
outer = char*width
inner = "{}{}{}".format(
char, fillchar*(width-2), char
)
rectangle = newline.join((outer, inner*(height-2), outer))
return rectangle
БГ
БГ
E
def get_rectangle(height=2, width=2, char="*", fillchar=" ", newline="\n"):
if width<2 or heigh<2:
raise ValueError("Incorrect rectangle size")
outer = char*width
inner = "{}{}{}".format(
char, fillchar*(width-2), char
)
rectangle = newline.join((outer, inner*(height-2), outer))
return rectangle
БГ
E