From f1c7fb9151b13b685e65d31b2919142571049b00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Efe=20=C5=9Eamil=20Sar=C4=B1g=C3=BCl?= Date: Tue, 3 Nov 2026 20:01:17 +0300 Subject: [PATCH] Add function to calculate pyramid height from blocks --- Week03/pyramid_efe_samil_sarigul.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 Week03/pyramid_efe_samil_sarigul.py diff --git a/Week03/pyramid_efe_samil_sarigul.py b/Week03/pyramid_efe_samil_sarigul.py new file mode 100644 index 00000000..7322de28 --- /dev/null +++ b/Week03/pyramid_efe_samil_sarigul.py @@ -0,0 +1,6 @@ +def calculate_pyramid_height(number_of_blocks): + height = 0 + while number_of_blocks >= height + 1: + height += 1 + number_of_blocks -= height + return height