Skip to content

Commit

Permalink
Merge pull request #149 from einsteinpikachu/master
Browse files Browse the repository at this point in the history
Create all_files_mehmet_osman_akgun.py
  • Loading branch information
canbula authored Oct 17, 2023
2 parents 06938a6 + 780933a commit c93cabf
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Week02/sequences_mehmet_osman_akgun.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
my_list = ["apple", "melon", "peach", 20, 'd', "apple", 2]
my_tuple = (1, 2, 3)
my_set = {4, 4, 2}
my_dict = {1: "ziraat", 2: "is", 3: "garanti"}

"""This function removes duplicates."""
def remove_duplicates(mylist: list) -> list:
return list(set(mylist))

"""This function counts items."""
def list_counts(moaList: list) -> dict:
counts = {}
for moa in moaList:
if moa in counts:
counts[moa] += 1
else:
counts[moa] = 1
return counts

"""This function reverse dict."""
def reverse_dict(input_moa: dict) -> dict:
reversed_dict = {element: key for key, element in input_moa.items()}
return reversed_dict

4 changes: 4 additions & 0 deletions Week02/types_mehmet_osman_akgun.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
my_int = 20
my_float = 30.1
my_bool = False
my_complex = 3j

0 comments on commit c93cabf

Please sign in to comment.