Skip to content

Commit 332028c

Browse files
authored
Merge pull request #93 from ferhatkurkcuoglu/patch-2
Create sequences_ferhat_kurkcuoglu.py
2 parents 063f01c + 66753e1 commit 332028c

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

Week02/sequences_ferhat_kurkcuoglu.py

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
my_list = [3, 4, 5, 6, 9, 8, 3, 9, 10, 11, 3, 6]
2+
my_tuple = (1, 3, 5, 7, 8, 9)
3+
my_set = {5, 6, 7, 8, 9, 0}
4+
my_dict = {"name": "Ferhat", "surname": "Kurkcuoglu", "age": 23}
5+
6+
def remove_duplicates(my_list) -> list:
7+
8+
return list(set(my_list))
9+
10+
11+
def list_counts(my_list) -> dict:
12+
count = dict()
13+
for i in my_list:
14+
if i in count:
15+
count[i] += 1
16+
else:
17+
count[i] = 1
18+
return count
19+
20+
21+
def reverse_dict(my_dict) -> dict:
22+
reversed_dict = dict()
23+
for k,v in my_dict.items():
24+
reversed_dict[v] = k
25+
return reversed_dict

0 commit comments

Comments
 (0)