Skip to content

Commit a7675c7

Browse files
authored
Create pyramid_elif_gulseren.py
1 parent 9a399e7 commit a7675c7

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎Week03/pyramid_elif_gulseren.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+
layer_blocks = 1
4+
5+
while number_of_blocks >= layer_blocks:
6+
number_of_blocks -= layer_blocks
7+
height += 1
8+
layer_blocks += 1
9+
10+
return height

0 commit comments

Comments
 (0)