From 3ead8fc06b446d76ce7e63feecf6caa68b3e5647 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Burak=20Sart=C4=B1k?= Date: Tue, 27 Oct 2026 10:11:14 +0300 Subject: [PATCH] Add function to calculate pyramid height from blocks --- Week03/pyramid_burak_sartik.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 Week03/pyramid_burak_sartik.py diff --git a/Week03/pyramid_burak_sartik.py b/Week03/pyramid_burak_sartik.py new file mode 100644 index 00000000..da898937 --- /dev/null +++ b/Week03/pyramid_burak_sartik.py @@ -0,0 +1,6 @@ +def calculate_pyramid_height(number_of_blocks): + height = 0 + while number_of_blocks > height: + height += 1 + number_of_blocks -= height + return height