Skip to content

Commit 446406f

Browse files
authored
Create pyramid_kayra_hokenek.py
1 parent 8cfff6e commit 446406f

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎Week03/pyramid_kayra_hokenek.py‎

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

0 commit comments

Comments
 (0)