Skip to content

Commit be29640

Browse files
Create pyramid_ridvan_celebi.py
1 parent f9db1ae commit be29640

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)