How to delete words from dictionary - by using keyword “del”

PHOTO EMBED

Tue Apr 21 2020 05:22:45 GMT+0000 (Coordinated Universal Time)

Saved by @Hitech #python #python #dictionary #del

def minus_key(key, dictionary):

shallow_copy = dict(dictionary)

del shallow_copy[key]

return shallow_copy
                               
                                
content_copyCOPY

"del" is the keyword that is used to delete word from dictionary.

https://stackoverflow.com/questions/5844672/delete-an-element-from-a-dictionary