diff --git a/Week03/pyramid_fevzi_bagriacik.py b/Week03/pyramid_fevzi_bagriacik.py new file mode 100644 index 00000000..baba4150 --- /dev/null +++ b/Week03/pyramid_fevzi_bagriacik.py @@ -0,0 +1,18 @@ +def calculate_pyramid_height(number_of_blocks): + height = 0 + total = 0 + + for i in range(1,number_of_blocks+2,1): + + total += i + + if number_of_blocks == total: + height = i + break + elif number_of_blocks < total: + height = i - 1 + break + + + + return height