Skip to content

Commit 148217f

Browse files
authored
Create pyramid_serifburak_kalkan.py
1 parent f2a63c2 commit 148217f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Week03/pyramid_serifburak_kalkan.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
def calculate_pyramid_height(number_of_blocks):
2+
height = 0
3+
count = 1
4+
while number_of_blocks >= 1:
5+
count += 1
6+
height += 1
7+
for i in range(0, count):
8+
number_of_blocks -= 1
9+
if number_of_blocks < 1:
10+
break
11+
return height

0 commit comments

Comments
 (0)