From d9ad3ad37ebf9de91264e094ea0af405c221732f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20Balc=C4=B1?= <148548201+MehmetxBalci@users.noreply.github.com> Date: Tue, 17 Mar 2026 00:39:43 +0300 Subject: [PATCH] Add function to calculate pyramid height from blocks --- Week03/pyramid_mehmet_balci.py | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Week03/pyramid_mehmet_balci.py diff --git a/Week03/pyramid_mehmet_balci.py b/Week03/pyramid_mehmet_balci.py new file mode 100644 index 00000000..e936626e --- /dev/null +++ b/Week03/pyramid_mehmet_balci.py @@ -0,0 +1,2 @@ +def calculate_pyramid_height(number_of_blocks): + return int(((-1 + (1 + 8 * number_of_blocks) ** 0.5) / 2))