Answers for "turn tuple into dictionary"

-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

Code answers related to "turn tuple into dictionary"

Python Answers by Framework

Browse Popular Code Answers by Language