We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 669cc4e commit a233c10Copy full SHA for a233c10
Week03/pyramid_tufan_sengel.py
@@ -0,0 +1,17 @@
1
+input_Cube_number = int(input("number of cubes : "))
2
+
3
+def calculate_pyramid_height(number_of_blocks):
4
+ piramit_cube_height = 1
5
+ cube_number_of_piramit = 0
6
7
+ while True:
8
+ if cube_number_of_piramit > number_of_blocks:
9
+ break
10
+ cube_number_of_piramit += piramit_cube_height
11
+ piramit_cube_height += 1
12
13
+ piramit_cube_height -= 2
14
+ print("the height of the piramit is : ", piramit_cube_height)
15
+ return piramit_cube_height
16
17
+calculate_pyramid_height(input_Cube_number)
0 commit comments