diff --git a/Week03/pyramid_yagmur_tokdemir.py b/Week03/pyramid_yagmur_tokdemir.py new file mode 100644 index 00000000..0accc1a2 --- /dev/null +++ b/Week03/pyramid_yagmur_tokdemir.py @@ -0,0 +1,10 @@ +def calculate_pyramid_height(number_of_blocks): + + height = 0 + total_boxes = 0 + + while total_boxes + (height + 1) <= number_of_blocks: + height += 1 + total_boxes += height + + return height