From 36b13bfcb9227682da3ce12659a53127d2ecf6eb Mon Sep 17 00:00:00 2001 From: meldag006 Date: Tue, 20 Oct 2026 14:34:34 +0300 Subject: [PATCH] Add function to calculate pyramid height from blocks --- Week03/pyramid_melda_gungor.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 Week03/pyramid_melda_gungor.py diff --git a/Week03/pyramid_melda_gungor.py b/Week03/pyramid_melda_gungor.py new file mode 100644 index 00000000..7d2ed0d1 --- /dev/null +++ b/Week03/pyramid_melda_gungor.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