From ec9f55fcc40d8510011680ff3287216fbbeb964c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0brahim=20As?= <148447898+zteplez@users.noreply.github.com> Date: Mon, 9 Nov 2026 14:59:10 +0300 Subject: [PATCH] Add function to calculate pyramid height from blocks --- Week03/pyramid_ibrahim_as.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 Week03/pyramid_ibrahim_as.py diff --git a/Week03/pyramid_ibrahim_as.py b/Week03/pyramid_ibrahim_as.py new file mode 100644 index 00000000..7322de28 --- /dev/null +++ b/Week03/pyramid_ibrahim_as.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