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.
2 parents 50c7545 + e4fce9a commit f43056eCopy full SHA for f43056e
Week03/pyramid_merve_yagiz.py
@@ -0,0 +1,18 @@
1
+
2
+# number_of_blocks = 10
3
4
+def calculate_pyramid_height(number_of_blocks):
5
+ block = 1
6
+ height = 0
7
+ while number_of_blocks >= block: # Koşulu düzelttik
8
+ number_of_blocks -= block # number_of_blocks değerini güncelliyoruz
9
+ #print("Kalan blok:", number_of_blocks)
10
+ height += 1
11
+ #print("Height:", height)
12
+ block += 1
13
+ #print("Block:", block)
14
+ return height
15
16
+# Fonksiyonu çağırarak sonucu görelim
17
+#print("Pyramid height:", calculate_pyramid_height(number_of_blocks))
18
0 commit comments