Course
Simulator
More
Premium
Log in
Python Function Reference
Functions
get
get
Return the value for key if key is in the dictionary, else default.
Python 3.13
dict
.
get
(
key
,
default
=
None
)
default
The default value.
Examples
Python 3.13
>>
>
a
=
{
'x'
:
1
,
'y'
:
2
}
>>
>
a
.
get
(
'z'
,
0
)
0