delete dict from list python code example
Example 1: remove element from dictionary python
thisdict = {
"brand": "Ford",
"model": "Mustang",
"year": 1964
}
thisdict.pop("model")
Example 2: remove element from dictionary python
dict.pop("key")
Example 3: how to remove item from dictionary python
thisdict = {
"brand": "Ford",
"model": "Mustang",
"year": 1964
}
thisdict.pop("model")
print(thisdict)
Example 4: remove elements from dictionary python
squares = {1: 1, 2: 4, 3: 9, 4: 16, 5: 25}
print(squares.pop(4))