From 323f2f59c5ff472b43e57e43f8a9e50ca13c314d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Heval=20S=C3=B6=C4=9F=C3=BCt?= <66115650+hevalsogut@users.noreply.github.com> Date: Sun, 16 Nov 2025 11:33:52 +0300 Subject: [PATCH] Add function to calculate pyramid height. --- Week03/pyramid_heval_sogut.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 Week03/pyramid_heval_sogut.py diff --git a/Week03/pyramid_heval_sogut.py b/Week03/pyramid_heval_sogut.py new file mode 100644 index 00000000..09819dcb --- /dev/null +++ b/Week03/pyramid_heval_sogut.py @@ -0,0 +1,10 @@ +def calculate_pyramid_height(number_of_blocks): + height = 0 + row = 1 + + while number_of_blocks >= row: + number_of_blocks -= row + height += 1 + row += 1 + + return height