Skip to content

Commit 9e37e8a

Browse files
Create pyramid_hasan_berke_sanal.py
1 parent b536459 commit 9e37e8a

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

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

0 commit comments

Comments
 (0)