Skip to content

Create sequences_beyza_saygili #54

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
26 changes: 26 additions & 0 deletions Week02/sequences_beyza_saygili
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
my_list = ["ankara", "canakkale", "izmir", "istanbul", "ankara", "bursa", "ankara"]
my_tuple = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
my_set = {"blossom", "bubbles", "buttercup"}
my_dict = {
"Name": "harry",
"Surname": "potter",
"job": "student",
"location": "hogwarts",
"age": 16}


def no_duplicates(my_list):
new_list = []
for i in my_list:
if i not in new_list:
new_list.append(i)
return new_list

def list_counts(my_list):
return {i : my_list.count(i) for i in my_list}

def reversed_dict(my_dict):
reversed_dict = {}
for key,value in my_dict.items():
reversed_dict[value] = key
return reversed_dict