diff --git a/Week03/sequences_ilyas_bugra_filoglu.py b/Week03/sequences_ilyas_bugra_filoglu.py new file mode 100644 index 00000000..f587d855 --- /dev/null +++ b/Week03/sequences_ilyas_bugra_filoglu.py @@ -0,0 +1,15 @@ +def remove_duplicates(seq: list) -> list: + production = [] + for item in seq: + if item not in production: + production.append(item) + return production + +def list_counts(seq: list) -> dict: + counts = {} + for item in seq: + counts[item] = counts.get(item, 0) + 1 + return counts + +def reverse_dict(d: dict) -> dict: + return {value: key for key, value in d.items()}