Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HW:Week-2 types_&sequences_ #150

Merged
merged 5 commits into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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