Home >>Python Dictionary Methods >Python Dictionary items() Method
Python Dictionary items() Method in python dictionary returns a new view object of the dictionary (key, value) as tuple pairs in a list. It does not take any parameter.
Syntax:dictionary.items()Here is an example of Python Dictionary items() Method:
det =
{
"name": "ram",
"lastname": "Mustang",
"year": 1990
}
a = det.items()
print(a)
per = {'name':'sohan', 'course':'m.Tech', 'email':'sohan@gmail.com'}
for st in per:
print("(",st, ":", per[st], end="), ")
items = per.items()
print("\n", items)