Web Analytics

Python dict.keys() Method

Dictionary Method โ€ข Keys

The keys() method returns a view object. The view object contains the keys of the dictionary, as a list.

The view object will reflect any changes done to the dictionary.

Syntax

dictionary.keys()

Parameters

No parameters.

Return Value

A view object containing the keys.

Example

Using the keys() method:

Output
Click Run to execute your code

Related Functions