Snippets Collections
def minus_key(key, dictionary):

shallow_copy = dict(dictionary)

del shallow_copy[key]

return shallow_copy
                               
                                
star

Tue Apr 21 2020 05:22:45 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/5844672/delete-an-element-from-a-dictionary

#python #python #dictionary #del

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension