Answers for "how to remove an item from dict python"

8

python delete value from dictionary

dict.pop('key')

#optionally you can give value to return if key doesn't exist (default is None)
dict.pop('key', 'key not found')
Posted by: Guest on May-25-2020

Code answers related to "how to remove an item from dict python"

Python Answers by Framework

Browse Popular Code Answers by Language