Articles → Python → Dictionary items function in python

Dictionary items function in python






Purpose





Example


# A dictionary with 2 keys i.e. name and age
dict = {"name":"gyan", "age":18}

# Convert to list and print list of items
print("Items-", list(dict.items()))



Output



Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Monday, April 08, 2019

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250