Skip to content

Commit 0dbcb98

Browse files
authored
Create pyramid_umut_eren_kaplan.py
1 parent 016e01b commit 0dbcb98

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Week03/pyramid_umut_eren_kaplan.py

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
def calculate_pyramid_height(number_of_blocks):
2+
height = 0
3+
usedblocks = 0
4+
5+
while usedblocks < number_of_blocks:
6+
usedblocks +=1
7+
height+=1
8+
number_of_blocks -=height
9+
10+
return height

0 commit comments

Comments
 (0)