From 20db4bf203dc8ea58af3d6001bfa70a4e43f8797 Mon Sep 17 00:00:00 2001 From: zainebkchaou <163732105+zainebkchaou@users.noreply.github.com> Date: Fri, 3 Apr 2026 19:46:49 +0300 Subject: [PATCH] Create pyramid_height_zaineb_kchaou.py --- Week03/pyramid_height_zaineb_kchaou.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 Week03/pyramid_height_zaineb_kchaou.py diff --git a/Week03/pyramid_height_zaineb_kchaou.py b/Week03/pyramid_height_zaineb_kchaou.py new file mode 100644 index 00000000..70d59197 --- /dev/null +++ b/Week03/pyramid_height_zaineb_kchaou.py @@ -0,0 +1,11 @@ +def calculate_pyramid_height(number_of_blocks): + height = 0 + blocks_needed = 1 + while number_of_blocks >= blocks_needed: + number_of_blocks -= blocks_needed + height += 1 + blocks_needed += 1 + return height + +c= calculate_pyramid_height(6) +print(c)