Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

poython str to dict

>>> D1={'1':1, '2':2, '3':3}
>>> s=str(D1)
>>> import ast
>>> D2=ast.literal_eval(s)
>>> D2
{'1': 1, '2': 2, '3': 3}

Source by www.tutorialspoint.com #
 
PREVIOUS NEXT
Tagged: #poython #str #dict
ADD COMMENT
Topic
Name
6+3 =