Skip to content

Commit 94fa575

Browse files
authored
Sequences_miray_cengil.py
1 parent e1c0cfd commit 94fa575

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Week03/sequences_miray_cengil.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def list_counts(seq: list) -> dict:
1717
return counts
1818

1919
def reverse_dict(d: dict) -> dict:
20-
new_dict = defaultdict(list)
20+
new_dict = {}
2121
for key, value in d.items():
22-
new_dict[value].append(key)
23-
return dict(new_dict)
22+
new_dict[value] = key
23+
return new_dict

0 commit comments

Comments
 (0)