Skip to content

Commit def6724

Browse files
authored
Merge pull request #749 from rridvancelebi/patch-3
Create pyramid_ridvan_celebi.py
2 parents fa67799 + be29640 commit def6724

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Week03/pyramid_ridvan_celebi.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)