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 55dd2ec + 3ba4812 commit fa67799Copy full SHA for fa67799
Week03/sequences_umut_eren_kaplan.py
@@ -0,0 +1,21 @@
1
+def remove_duplicates(seq: list) -> list:
2
+ """
3
+ This function removes duplicates from a list.
4
5
+ return list(set(seq))
6
+
7
+def list_counts(seq: list) -> dict:
8
9
+ This function counts the number of occurrences of each item in a list.
10
11
+ counted = {}
12
+ for item in seq:
13
+ counted[item] = seq.count(item)
14
+ return counted
15
16
+def reverse_dict(d: dict) -> dict:
17
18
+ This function reverses the keys
19
+ and values of a dictionary.
20
21
+ return {v: k for k, v in d.items()}
0 commit comments