diff --git a/Week03/pyramid_beytullah_arslan.py b/Week03/pyramid_beytullah_arslan.py new file mode 100644 index 000000000..d1747ea6d --- /dev/null +++ b/Week03/pyramid_beytullah_arslan.py @@ -0,0 +1,10 @@ +def calculate_pyramid_height(number_of_blocks): + total = 0 + height = 0 + for i in range(1, number_of_blocks + 1): + total += i + if total > number_of_blocks: + break + else: + height = i + return height