We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 9a05b96 + 0f9e19e commit 4431d5cCopy full SHA for 4431d5c
Week03/pyramid_cemil_koca.py
@@ -0,0 +1,9 @@
1
+def calculate_pyramid_height(number_of_blocks):
2
+ height = 0
3
+ remaining = number_of_blocks
4
+
5
+ while remaining >= height + 1:
6
+ height += 1
7
+ remaining -= height
8
9
+ return height
Week03/sequences_cemil_koca.py
@@ -0,0 +1,22 @@
+def remove_duplicates(seq):
+ result = []
+ for item in seq:
+ if item not in result:
+ result.append(item)
+ return result
+def list_counts(seq):
10
+ counts = {}
11
12
+ if item not in counts:
13
+ counts[item] = 0
14
+ counts[item] += 1
15
+ return counts
16
17
18
+def reverse_dict(d):
19
+ result = {}
20
+ for key in d:
21
+ result[d[key]] = key
22
0 commit comments