Skip to content

Commit 54e5577

Browse files
authored
Merge pull request #8 from alidumanyp/master
Types and Sequences homework added.
2 parents c03d451 + c0ebd38 commit 54e5577

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

Week02/sequences_ali_duman.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
my_list = [2, 4, 8, 16, 32, 64, 128, 256]
2+
3+
my_tuple = (11, 33, 55, "The", "Blacklist")
4+
5+
my_set = {"Raymond Reddington", "Elizabeth Keen", "Glen Carter"}
6+
7+
my_dict = {
8+
"one": "I",
9+
"two": "Had",
10+
"three": "Bullets",
11+
"four": "He",
12+
"five": "Had",
13+
"six": "Words"
14+
}
15+
16+
17+
def remove_duplicates(my_list):
18+
return list(set(my_list))
19+
20+
21+
def list_counts(my_list):
22+
return {item: my_list.count(item) for item in my_list}
23+
24+
25+
def reverse_dict(my_dict):
26+
return {value: key for key, value in my_dict.items()}

Week02/types_ali_duman.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
my_int = 12
2+
my_float = 32.7
3+
my_bool = True
4+
my_complex = 8j

0 commit comments

Comments
 (0)