Skip to content

Commit cb0c88a

Browse files
authored
Create pyramid_berra_soyler.py
1 parent 6a0ee87 commit cb0c88a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Week03/pyramid_berra_soyler.py

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

0 commit comments

Comments
 (0)