Skip to content

Commit 0abc160

Browse files
authored
Merge pull request #92 from UmitUnal/patch-2
Create sequences_umit_unal.py
2 parents b0b6923 + 8ae1fc6 commit 0abc160

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

Week02/sequences_umit_unal.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
my_list=[7, 9 , 11, 11 , 12, 17, 17, 25]
2+
my_tuple=(1, 2 ,3 ,4 ,5)
3+
my_set={"gta5", "watchdogs", "eycofcu1"}
4+
my_dict={"Name" : "Umit", "Surname" : "UNAL", "Age" : 23}
5+
6+
def remove_duplicates(my_list):
7+
return list(set(my_list))
8+
9+
def list_counts(my_list):
10+
counts = {}
11+
for i in my_list:
12+
if i in counts:
13+
counts[i] += 1
14+
else:
15+
counts[i] = 1
16+
return counts
17+
18+
def reverse_dict(my_dict):
19+
reversed_dict = {}
20+
for key, value in my_dict.items():
21+
reversed_dict[value] = key
22+
return reversed_dict
23+

0 commit comments

Comments
 (0)