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