0 points

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


dashboard

Tue Apr 21 2020 05:22:45 GMT+0000 (UTC)

Posted by @Hitech #python #python #dictionary #del

def minus_key(key, dictionary):

shallow_copy = dict(dictionary)

del shallow_copy[key]

return shallow_copy
                               
                                
content_copy Copy

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

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