Mapping Type Related Functions with dict() : Convert to Dictionary : Dictionary PYTHON TUTORIALS


PYTHON TUTORIALS » Dictionary » Convert to Dictionary »

 

Mapping Type Related Functions with dict()


print dict(zip(('x''y')(12)))
print dict([['x'1]['y'2]])
print dict([('xy'[i-1], ifor i in range(1,3)])
print dict(x=1, y=2)
dict1 = dict(x=1, y=2)
print dict1
dict2 = dict(**dict1)
print dict2



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Dictionary
» Convert to Dictionary