Skip to content

Commit 3ba658d

Browse files
authored
Merge pull request #714 from Zeyneepsudee/patch-1
Add function to calculate pyramid height - Zeynep Sude
2 parents 6b5224e + 7a87244 commit 3ba658d

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

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

0 commit comments

Comments
 (0)