From 2b1ec8c0efd7ae9747132452d4a9fdfdbe7263df Mon Sep 17 00:00:00 2001 From: Mykhailo Date: Sun, 20 Apr 2025 22:54:12 +0200 Subject: [PATCH] Update 03_task_symbols.md --- Lesson20/pactice/part01/03_task_symbols.md | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/Lesson20/pactice/part01/03_task_symbols.md b/Lesson20/pactice/part01/03_task_symbols.md index 09eb667..00156aa 100644 --- a/Lesson20/pactice/part01/03_task_symbols.md +++ b/Lesson20/pactice/part01/03_task_symbols.md @@ -30,5 +30,20 @@ height = 3 ### Решение задачи ```python -# TODO: you code here... -``` \ No newline at end of file +def print_rhombus_outline(height: int): + for i in range(height): + spaces_outside = height - 1 - i + if i == 0: + print( " "* spaces_outside + "/" + "\\") # + elif i == height - 1 : + spaces_inside = 2 * i + print("/" + "_" * spaces_inside + "\\") + else: + spaces_inside = 2 * i + print(" "* spaces_outside + "/" + " " * spaces_inside + "\\") + + +height = int(input("2 <= height <= 15: ")) + +print_rhombus_outline(height) +```