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 4f332ed commit 53ed69cCopy full SHA for 53ed69c
Week03/sequences_tarik_bozgan.py
@@ -0,0 +1,23 @@
1
+def remove_duplicates(seq):
2
+ result = []
3
+ for item in seq:
4
+ if item not in result:
5
+ result.append(item)
6
+ return result
7
+
8
9
+def list_counts(seq):
10
+ counts = {}
11
12
+ if item in counts:
13
+ counts[item] += 1
14
+ else:
15
+ counts[item] = 1
16
+ return counts
17
18
19
+def reverse_dict(d):
20
+ reversed_dict = {}
21
+ for key, value in d.items():
22
+ reversed_dict[value] = key
23
+ return reversed_dict
0 commit comments