From d0f6aa31b03e39df67aca4a2124af2c165a199b4 Mon Sep 17 00:00:00 2001 From: UmuTurk230315070 <230315070@ogr.cbu.edu.tr> Date: Tue, 24 Mar 2026 10:11:53 +0300 Subject: [PATCH] Add files via upload --- Week03/pyramid_umut_turk.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 Week03/pyramid_umut_turk.py diff --git a/Week03/pyramid_umut_turk.py b/Week03/pyramid_umut_turk.py new file mode 100644 index 00000000..48b495b4 --- /dev/null +++ b/Week03/pyramid_umut_turk.py @@ -0,0 +1,12 @@ +def calculate_pyramid_height(number_of_blocs): + a = 0 + p_block = 0 + while number_of_blocs > p_block: + a +=1 + p_block += a + if number_of_blocs == p_block: + height = a + else: + height = a-1 + + return height \ No newline at end of file