From 63c1e639270e05f1033265fd842c6285aa6d0559 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Tun=C3=A7?= <58087692+Batuhaanccs@users.noreply.github.com> Date: Wed, 18 Nov 2026 22:48:06 +0300 Subject: [PATCH] Add function to calculate pyramid height from blocks --- Week03/pyramid_batuhan_tunc.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 Week03/pyramid_batuhan_tunc.py diff --git a/Week03/pyramid_batuhan_tunc.py b/Week03/pyramid_batuhan_tunc.py new file mode 100644 index 00000000..7322de28 --- /dev/null +++ b/Week03/pyramid_batuhan_tunc.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