-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #149 from einsteinpikachu/master
Create all_files_mehmet_osman_akgun.py
- Loading branch information
Showing
2 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |