Skip to content

Commit

Permalink
Merge pull request #150 from CanberkAkar/master
Browse files Browse the repository at this point in the history
HW:Week-2 types_&sequences_
  • Loading branch information
canbula authored Oct 16, 2023
2 parents 5bd6210 + fe85c0a commit 1e2ea17
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
30 changes: 30 additions & 0 deletions Week02/sequences_canberk_akar.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
my_list = ["a","b","c","d","e"]
my_tuple = ("canberk","akar",25)
my_set = {"honda","toyota","fiat","fiat"}
my_dict={
"name" :"The Sopranos",
"director" :"Tim Van Patten",
"year" :1998
}

def remove_duplicates(list):
dub=[]
for item in list:
if item not in dub:
dub.append(item)
return dub

def list_counts(list):
dictionary = {}
for item in list:
if item in dictionary:
dictionary[item] += 1
else:
dictionary[item] = 1
return dictionary

def reverse_dict(dictionary):
dict = {}
for item in dictionary.items():
dict[item[1]] = item[0]
return dict
4 changes: 4 additions & 0 deletions Week02/types_canberk_akar.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
my_int = 2
my_float = 5.9
my_bool = False
my_complex = 8 + 8j

0 comments on commit 1e2ea17

Please sign in to comment.