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