Skip to content

Commit a497c8b

Browse files
authored
Add function to calculate pyramid height from blocks
1 parent 9a399e7 commit a497c8b

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎Week03/pyramid_sedat_celik‎

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

0 commit comments

Comments
 (0)