@@ -152,4 +152,55 @@ def delete_from_dict(dict, *word):
152
152
print ('\n get_from_dict(my_english_dict, "kimchi"):' )
153
153
get_from_dict (my_english_dict , "kimchi" )
154
154
155
- # \/\/\/\/\/\/\ END DO NOT TOUCH \/\/\/\/\/\/\
155
+ # \/\/\/\/\/\/\ END DO NOT TOUCH \/\/\/\/\/\/\
156
+
157
+
158
+ # def add_to_dict(a_dict, word="", definition=""):
159
+ # if type(a_dict) is not dict:
160
+ # print("You need to send a dictionary. You sent:", type(a_dict))
161
+ # elif word == '' or definition == '':
162
+ # print("You need to send a word and a definition.")
163
+ # else:
164
+ # if word in a_dict:
165
+ # print(f"{word} is already on the dictionary. Won't add.")
166
+ # else:
167
+ # a_dict[word] = definition
168
+ # print(word,"has been added.")
169
+
170
+
171
+ # def get_from_dict(a_dict, word=""):
172
+ # if type(a_dict) is not dict:
173
+ # print("You need to send a dictionary. You sent:", type(a_dict))
174
+ # elif word == '':
175
+ # print("You need to send a word to search for.")
176
+ # else:
177
+ # if word not in a_dict:
178
+ # print(f"{word} was not found in this dict.")
179
+ # else:
180
+ # print(f"{word}: {a_dict[word]}")
181
+
182
+
183
+ # def update_word(a_dict, word="", definition=""):
184
+ # if type(a_dict) is not dict:
185
+ # print("You need to send a dictionary. You sent:", type(a_dict))
186
+ # elif word == "" or definition == "":
187
+ # print("You need to send a word and a definition to update.")
188
+ # else:
189
+ # if word not in a_dict:
190
+ # print(f"{word} is not on the dict. Can't update non-existing word.")
191
+ # else:
192
+ # a_dict[word] = definition
193
+ # print(word, "has been updated to:", definition)
194
+
195
+
196
+ # def delete_from_dict(a_dict, word=""):
197
+ # if type(a_dict) is not dict:
198
+ # print("You need to send a dictionary. You sent:", type(a_dict))
199
+ # elif word == "":
200
+ # print("You need to specify a word to delete.")
201
+ # else:
202
+ # if word not in a_dict:
203
+ # print(f"{word} is not in this dict. Won't delete.")
204
+ # else:
205
+ # del a_dict[word]
206
+ # print(f"{word} has been deleted.")
0 commit comments