From ddcecab8cc29da2cb0a183939e41214e89058721 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleyna=20G=C3=BCltekin?= Date: Thu, 15 Oct 2026 14:27:20 +0300 Subject: [PATCH] Add function to calculate pyramid height from blocks --- Week03/Week03/pyramid_aleyna_gultekin.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 Week03/Week03/pyramid_aleyna_gultekin.py diff --git a/Week03/Week03/pyramid_aleyna_gultekin.py b/Week03/Week03/pyramid_aleyna_gultekin.py new file mode 100644 index 000000000..7322de282 --- /dev/null +++ b/Week03/Week03/pyramid_aleyna_gultekin.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