From ba0043ab3b0e144f1efea602c619a1c2c7f99265 Mon Sep 17 00:00:00 2001 From: Ebrukoksal <114864294+Ebrukoksal@users.noreply.github.com> Date: Tue, 3 Mar 2026 11:53:01 +0300 Subject: [PATCH] Add function to calculate pyramid height from blocks --- Week03/pyramid_ebru_koksal.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 Week03/pyramid_ebru_koksal.py diff --git a/Week03/pyramid_ebru_koksal.py b/Week03/pyramid_ebru_koksal.py new file mode 100644 index 00000000..f9aaddd5 --- /dev/null +++ b/Week03/pyramid_ebru_koksal.py @@ -0,0 +1,10 @@ +def calculate_pyramid_height(number_of_blocks): + height = 0 + i = 1 + + while number_of_blocks >= i: + number_of_blocks = number_of_blocks - i + height += 1 + i += 1 + + return height