Skip to content

Commit 4e08e0c

Browse files
committed
Created pyramid_first_last.py
1 parent 4093f0e commit 4e08e0c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Week03/pyramid_first_last.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
def calculate_pyramid_height(number_of_blocks):
2+
height = 0
3+
while(number_of_blocks >= 0):
4+
height += 1
5+
number_of_blocks -= height
6+
return height - 1
7+

0 commit comments

Comments
 (0)