items Method in Python: Key-Value Pairs

Provides a view of the dictionary as a sequence of (key, value) tuples. This view is useful for iterating over the dictionary or creating a new dictionary.

items()

data = {'one': 1, 'two': 2, 'three': 3}

for key, value in data.items():
    print(key, value)