Skip to content

Commit 64ad768

Browse files
authored
Merge pull request #816 from sedat000/patch-2
Add function to calculate pyramid height from blocks
2 parents 9b0f707 + a09ac3f commit 64ad768

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎Week03/pyramid_sedat_celik.py‎

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)