Web Analytics

Python dict.get() Method

Dictionary Method โ€ข Access

The get() method returns the value of the item with the specified key.

Syntax

dictionary.get(keyname, value)

Parameters

Parameter Description
keyname Required. The keyname of the item you want to return the value from
value Optional. A value to return if the specified key does not exist. Default value None

Return Value

The value of the item with the specified key.

Example

Using the get() method:

Output
Click Run to execute your code

Related Functions