diff --git a/Week03/pyramid_heval_sogut.py b/Week03/pyramid_heval_sogut.py new file mode 100644 index 00000000..09819dcb --- /dev/null +++ b/Week03/pyramid_heval_sogut.py @@ -0,0 +1,10 @@ +def calculate_pyramid_height(number_of_blocks): + height = 0 + row = 1 + + while number_of_blocks >= row: + number_of_blocks -= row + height += 1 + row += 1 + + return height