Skip to content

Commit c483bd1

Browse files
authored
Create pyramid_niyazi_cetinkaya.py
1 parent 54d0c5f commit c483bd1

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Week03/pyramid_niyazi_cetinkaya.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: int) -> int:
2+
height = 0
3+
while True:
4+
if number_of_blocks > height*(height+1)/2:
5+
height = height + 1
6+
else:break
7+
return height
8+
9+
10+
print(calculate_pyramid_height(7))

0 commit comments

Comments
 (0)