.items()

The .items() method of a Python dictionary returns a list of tuples for each key-value pair in a dictionary. It takes no arguments.

Syntax

dictionary.items()

Codebyte Example

The following example creates a dictionary, then prints the dictionary and the output from .items():

Code
Output
Loading...

Contributors

Interested in helping build Docs? Read the Contribution Guide or share your thoughts in this feedback form.

Learn Python on Codecademy