Skip to content

Commit 3affb4e

Browse files
authored
Update sequences_beyza_sungar.py
1 parent a1a3b08 commit 3affb4e

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

Week02/sequences_beyza_sungar.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
1-
my_list = [1,2,3,4,5]
2-
my_tuple = (3,6,9,9,8,7,4,5,4)
3-
my_set = {4,7,8,7,8,9}
4-
my_dict = {"name" : "Beyza",
5-
"surname" :"Sungar",
6-
"city" : "Eskişehir",
7-
"age" : 22}
1+
my_list = [1, 2, 3, 4, 5]
2+
my_tuple = (3, 6, 9, 9, 8, 7, 4, 5, 4)
3+
my_set = {4, 7, 8, 7, 8, 9}
4+
my_dict = {
5+
"name": "Beyza",
6+
"surname": "Sungar",
7+
"city": "Eskişehir",
8+
"age": 21
9+
}
810

911
def remove_duplicates(my_list):
10-
return list(set(my_list))
12+
return list(set(my_list))
1113

1214
def list_counts(my_list):
13-
counts = {}
14-
for item in input_list:
15+
counts = {}
16+
for item in my_list:
1517
if item in counts:
1618
counts[item] += 1
1719
else:
1820
counts[item] = 1
1921
return counts
2022

21-
def reverse_key(dictionary):
23+
def reverse_dict(dictionary):
2224
return {value: key for key, value in dictionary.items()}

0 commit comments

Comments
 (0)