Function Details: items

Description


Returns a new view of the dictionary's items ((key, value) pairs).


Extended Description


The items() method returns a view object containing the key-value pairs of the dictionary as tuples. This view object is dynamic, meaning it reflects any changes made to the dictionary. The items view supports set operations when compared to other views, making it useful for comparing dictionaries.


Function Signature


dict.items() -> dict_items

Module: dict

Class: dictionary

Parameters



Return


Returns a dict_items object, which is a view of the dictionary's (key, value) pairs.


Return Type


dict_items

Output

Explanation

This example shows how to use items() and convert the result to a list.