Skip to content

Commit eed1f0e

Browse files
Update pyramid_fevzi_bagriacik.py
1 parent 456f6f8 commit eed1f0e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Week03/pyramid_fevzi_bagriacik.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@ def calculate_pyramid_height(number_of_blocks):
66

77
total += i
88

9-
if(number_of_blocks <= total):
9+
if number_of_blocks == total:
1010
height = i
1111
break
12+
elif number_of_blocks < total:
13+
height = i - 1
14+
break
1215

1316

1417

0 commit comments

Comments
 (0)