We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 640b89b + 9e68344 commit 228e44aCopy full SHA for 228e44a
Week03/pyramid_ege_enc.py
@@ -0,0 +1,10 @@
1
+def calculate_pyramid_height(number_of_blocks):
2
+ n = 1
3
+ height = 0
4
+
5
+ while number_of_blocks >= n:
6
+ height += 1
7
+ number_of_blocks -= n
8
+ n += 1
9
10
+ return height
Week03/sequences_ege_enc.py
@@ -0,0 +1,17 @@
+def remove_duplicates(seq : list) -> list:
+ return list(set(seq))
+def list_counts(seq:list) -> dict:
+ d = {}
+ for i in seq:
+ if i in d:
+ d[i] += 1
+ else:
+ d[i] = 1
11
+ return d
12
13
+def reverse_dict(d : dict) -> dict:
14
+ nd = {}
15
+ for i, h in d.items():
16
+ nd[h] = i
17
+ return nd
0 commit comments