Найти - Пользователи
Полная версия: Задание на зачет!
Начало » Центр помощи » Задание на зачет!
1
ellinishe
Здравствуйте, помогите пожалуйста переписать код так, чтобы с помощью символов <> выводился крест X
def bar():
print(“#”, 16 * “=”, “#”)

def draw_top_half():
for line in range(1, 5):
print(“|”, end=“ ”)
print(“ ” * (-2 * line + 8), end=“<>”)
print(“.” * ( 4 * line - 4), end=“<>”)
print(“ ” * (-2 * line + 8), end=“ ”)
print(“|”, end=“\n”)

def draw_bottom_half():
for line in range(4, 0, -1):
print(“|”, end=“ ”)
print(“ ” * (-2 * line + 8), end=“<>”)
print(“.” * ( 4 * line - 4), end=“<>”)
print(“ ” * (-2 * line + 8), end=“ ”)
print(“|”, end=“\n”)

bar()
draw_top_half()
draw_bottom_half()
bar()
botinag
def run():
    bar()
    draw_top_half()
    draw_bottom_half()
    bar()

>>> run()
('#', '================', '#')
| <><> |
| <>....<> |
| <>........<> |
| <>............<> |
| <>............<> |
| <>........<> |
| <>....<> |
| <><> |
('#', '================', '#')
def run2():
    bar()
    draw_bottom_half()
    draw_top_half()
    bar()

>>> run2()
('#', '================', '#')
| <>............<> |
| <>........<> |
| <>....<> |
| <><> |
| <><> |
| <>....<> |
| <>........<> |
| <>............<> |
('#', '================', '#')
ellinishe
Спасибо!!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB