From 0750e621abfa5612ed6e230f16ef651bdf4f03fe Mon Sep 17 00:00:00 2001 From: Sergenops Date: Mon, 9 Nov 2026 18:49:10 +0300 Subject: [PATCH] Add function to calculate pyramid height --- Week03/pyramid_sergen_maksutlar.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 Week03/pyramid_sergen_maksutlar.py diff --git a/Week03/pyramid_sergen_maksutlar.py b/Week03/pyramid_sergen_maksutlar.py new file mode 100644 index 00000000..7322de28 --- /dev/null +++ b/Week03/pyramid_sergen_maksutlar.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