From 446406fb44ee6878ae3911782787ed5fb72fc555 Mon Sep 17 00:00:00 2001 From: kayra-jpeg Date: Tue, 17 Nov 2026 15:46:15 +0300 Subject: [PATCH] Create pyramid_kayra_hokenek.py --- Week03/pyramid_kayra_hokenek.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 Week03/pyramid_kayra_hokenek.py diff --git a/Week03/pyramid_kayra_hokenek.py b/Week03/pyramid_kayra_hokenek.py new file mode 100644 index 00000000..bcfb008f --- /dev/null +++ b/Week03/pyramid_kayra_hokenek.py @@ -0,0 +1,10 @@ +def calculate_pyramid_height(number_of_blocks): + height = 0 + floor_blocks = 1 + + while number_of_blocks >= floor_blocks: + height += 1 + number_of_blocks -= floor_blocks + floor_blocks += 1 + + return height