[] (key lookup)

Description

Returns the value associated with the given key.

Syntax

dict [key]

key
Required. Key which value is to be retrieved.

Return Value

The same as associated with key.

Time Complexity

#TODO

Remarks

If key is not found throws KeyError.

Example

>>> {'a': 1, 'b': 2}['a']
1

See Also

#TODO