diff --git a/Week03/pyramid_dilek_celebi.py b/Week03/pyramid_dilek_celebi.py new file mode 100644 index 00000000..938ea6ad --- /dev/null +++ b/Week03/pyramid_dilek_celebi.py @@ -0,0 +1,9 @@ +def calculate_pyramid_height(number_of_blocks): + current_height = 0 + blocks_used = 0 + + while blocks_used + current_height + 1 <= number_of_blocks: + current_height += 1 + blocks_used += current_height + + return current_height