Course
Simulator
More
Premium
Log in
Python Function Reference
Functions
dict.pop
dict.pop
If key is in the dictionary, remove it and return its value, else return default.
Python 3.13
dict
.
pop
(
key
,
default
=
None
)
key
The key to remove.
default
The default value.
Examples
Python 3.13
>>
>
a
=
{
'x'
:
1
,
'y'
:
2
}
>>
>
a
.
pop
(
'x'
)
1