Skip to content

Commit

Permalink
Merge pull request #151 from eagarer/master
Browse files Browse the repository at this point in the history
HW: week2 types_ & sequences
  • Loading branch information
canbula authored Oct 16, 2023
2 parents 9d6d537 + 5c2f12f commit cb0ed7a
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
32 changes: 32 additions & 0 deletions Week02/sequences_eray_agarer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
my_list = ["apple", "pear", "banana", "strawberry","apple"]
my_tuple = ("linux", "windows",190316084, True)
my_set = {"html", "css" ,"javascript",2023,2023}
my_dict = {
"name": "eray",
"surname":"agarer",
"ID":190316084
}

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

def list_counts(list):
counted_dict = {}

for item in list:
if item in counted_dict:
counted_dict[item] += 1
else:
counted_dict[item] = 1

return counted_dict

def reverse_dict(dict):
reversed_dict = {value: key for key, value in dict.items()}
return reversed_dict


4 changes: 4 additions & 0 deletions Week02/types_eray_agarer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
my_int = 512
my_float = 12.8
my_bool = True
my_complex = 5j+5

0 comments on commit cb0ed7a

Please sign in to comment.