Skip to content

Commit edeca7b

Browse files
authored
Merge pull request #685 from Yummy0945/patch-4
Create pyramid_yagmur_tokdemir.py
2 parents f0e97ee + 3fe38b7 commit edeca7b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Week03/pyramid_yagmur_tokdemir.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
def calculate_pyramid_height(number_of_blocks):
2+
3+
height = 0
4+
total_boxes = 0
5+
6+
while total_boxes + (height + 1) <= number_of_blocks:
7+
height += 1
8+
total_boxes += height
9+
10+
return height

0 commit comments

Comments
 (0)