From ca031d3a76e749c4a1c30e1f8b8188ca93cda979 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Egehan=20Hatipo=C4=9Flu?= Date: Wed, 21 Oct 2026 16:07:49 +0300 Subject: [PATCH] Week3 Add function to calculate pyramid height from blocks --- Week03/pyramid_egehan_hatipoglu.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 Week03/pyramid_egehan_hatipoglu.py diff --git a/Week03/pyramid_egehan_hatipoglu.py b/Week03/pyramid_egehan_hatipoglu.py new file mode 100644 index 00000000..55fc064c --- /dev/null +++ b/Week03/pyramid_egehan_hatipoglu.py @@ -0,0 +1,9 @@ +def calculate_pyramid_height(number_of_blocks): + height = 0 + blocks = 0 + + while blocks + height + 1 <= number_of_blocks: + height += 1 + blocks += height + + return height