Skip to content

Commit 4b3317c

Browse files
authored
Add function to calculate pyramid height from blocks
1 parent 8b82b00 commit 4b3317c

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎Week03/pyramid_mehmet_balci.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def calculate_pyramid_height(number_of_blocks):
2+
return int(((-1 + (1 + 8 * number_of_blocks) ** 0.5) / 2))

0 commit comments

Comments
 (0)