Skip to content

Commit d2f328f

Browse files
Create sequences_beytullah_arslan.py
1 parent 8b82b00 commit d2f328f

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
def remove_duplicates(seq: list) -> list:
2+
return list(set(seq))
3+
4+
def list_counts(seq: list) -> dict:
5+
dictionary = dict.fromkeys(seq, 0)
6+
for item in seq:
7+
dictionary[item] += 1
8+
return dictionary
9+
10+
def reverse_dict(d: dict) -> dict:
11+
new_dict = {}
12+
for key, value in d.items():
13+
new_dict[value] = key
14+
return new_dict

0 commit comments

Comments
 (0)