Skip to content

Commit 1b75903

Browse files
authored
Merge pull request canbula#785 from JalilG0/patch-3
Add function to calculate pyramid height
2 parents 230b782 + 0c68fda commit 1b75903

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎Week03/pyramid_jalil_guliyev.py‎

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

0 commit comments

Comments
 (0)