Skip to content

Commit 1cf02e3

Browse files
authored
Merge pull request #824 from afrainanc/patch-3
Create pyramid_afra_inanc.py
2 parents 71d6b88 + e3b42ae commit 1cf02e3

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎Week03/pyramid_afra_inanc.py‎

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:
4+
height += 1
5+
number_of_blocks -= height
6+
return height

0 commit comments

Comments
 (0)