Skip to content

Commit 456f6f8

Browse files
Create pyramid_fevzi_bagriacik.py
1 parent 669cc4e commit 456f6f8

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Week03/pyramid_fevzi_bagriacik.py

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

0 commit comments

Comments
 (0)