Concept

dict()

This function is used to convert a tuple of order (key,value) into a dictionary.

a = 1 b = 2 tup = (('a', 1), ('f', 2), ('g', 3)) c = dict(tup) print(c)
{'a': 1, 'f': 2, 'g': 3}

0

0

Updated 2021-07-27

Contributors are:

Who are from:

Tags

Python Programming Language

Data Science