Skip to content

Commit 94d0cf0

Browse files
authored
Merge pull request #603 from serif1705/patch-5
Create pyramid_serifburak_kalkan.py
2 parents 0691273 + 148217f commit 94d0cf0

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)