From 0c68fda28b1145d261929259b36e639d98c9ab5d Mon Sep 17 00:00:00 2001 From: Jalil Guliyev Date: Sat, 31 Oct 2026 22:55:53 +0300 Subject: [PATCH] Add function to calculate pyramid height --- Week03/pyramid_jalil_guliyev.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 Week03/pyramid_jalil_guliyev.py diff --git a/Week03/pyramid_jalil_guliyev.py b/Week03/pyramid_jalil_guliyev.py new file mode 100644 index 00000000..c96a3cee --- /dev/null +++ b/Week03/pyramid_jalil_guliyev.py @@ -0,0 +1,9 @@ + +def calculate_pyramid_height(number_of_blocks): + height = 0 + + while number_of_blocks >= height + 1: + height += 1 + number_of_blocks -= height + + return height