From 1c52810a850bb5e4821eb8e5b2daa311bc35ebf2 Mon Sep 17 00:00:00 2001 From: KHalid102205 Date: Sat, 14 Mar 2026 00:42:14 +0300 Subject: [PATCH 1/2] Add function to calculate pyramid height from blocks --- "Week03/pyramid_khaled_al\304\261sma\304\261l.py" | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 "Week03/pyramid_khaled_al\304\261sma\304\261l.py" diff --git "a/Week03/pyramid_khaled_al\304\261sma\304\261l.py" "b/Week03/pyramid_khaled_al\304\261sma\304\261l.py" new file mode 100644 index 00000000..ac844f9b --- /dev/null +++ "b/Week03/pyramid_khaled_al\304\261sma\304\261l.py" @@ -0,0 +1,10 @@ +def calculate_pyramid_height(number_of_blocks): + height = 0 + blocks_needed = 1 + + while number_of_blocks >= blocks_needed: + number_of_blocks -= blocks_needed + height += 1 + blocks_needed += 1 + + return height From 967d75e3401ff45bfb95add44e55ed1a8aa229c2 Mon Sep 17 00:00:00 2001 From: KHalid102205 Date: Sun, 15 Mar 2026 15:04:13 +0300 Subject: [PATCH 2/2] =?UTF-8?q?Rename=20pyramid=5Fkhaled=5Fal=C4=B1sma?= =?UTF-8?q?=C4=B1l.py=20to=20pyramid=5Fkhaled=5Falismail.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pyramid_khaled_alismail.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename "Week03/pyramid_khaled_al\304\261sma\304\261l.py" => Week03/pyramid_khaled_alismail.py (100%) diff --git "a/Week03/pyramid_khaled_al\304\261sma\304\261l.py" b/Week03/pyramid_khaled_alismail.py similarity index 100% rename from "Week03/pyramid_khaled_al\304\261sma\304\261l.py" rename to Week03/pyramid_khaled_alismail.py