Answers for "how to convert dict form to string in opytthon"

4

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}
Posted by: Guest on June-30-2020
5

convert dict to string python

my_dict = {"Hello" : True, "World" : False}
print(str(my_dict))
Posted by: Guest on December-01-2020

Code answers related to "how to convert dict form to string in opytthon"

Browse Popular Code Answers by Language