Skip to content

Commit 6768a1f

Browse files
authored
Merge pull request #33 from gerisali/patch-2
Create sequences_ali_geris.py
2 parents 30c4c69 + ae25c94 commit 6768a1f

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Week03/sequences_ali_geris.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
def remove_duplicates(input_list):
2+
"""Tekrarlanan elemanları çıkar."""
3+
return list(dict.fromkeys(input_list))
4+
5+
def list_counts(input_list):
6+
"""Listedeki elemanların tekrar sayısı."""
7+
count_dict = {}
8+
for item in input_list:
9+
if item in count_dict:
10+
count_dict[item] += 1
11+
else:
12+
count_dict[item] = 1
13+
return count_dict
14+
15+
def reverse_dict(input_dict):
16+
return {value: key for key, value in input_dict.items()}

0 commit comments

Comments
 (0)