QUESTION IMAGE
Question
which method/keyword is used to remove a key - value pair from a dictionary?
o remove()
o delete()
o pop()
o del
Brief Explanations
In Python, the del keyword is used to remove a key - value pair from a dictionary. The pop() method also removes a key - value pair but returns the value. The remove() method is for lists (removes the first occurrence of a value). The delete() is not a standard method for dictionaries in Python.
Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
del