.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()
: