Answers for "dictionary to tuple list"

-1

dictionary to tuple python

# Python code to convert dictionary into list of tuples
 
# Initialization of dictionary
dict = { 'Geeks': 10, 'for': 12, 'Geek': 31 }
 
# Converting into list of tuple
list = list(dict.items())
 
# Printing list of tuple
print(list)

[('Geeks', 10), ('for', 12), ('Geek', 31)]
Posted by: Guest on July-26-2021

Python Answers by Framework

Browse Popular Code Answers by Language