Professional Documents
Culture Documents
Data Structures Algorithms Interview Preparation Topic-wise Practice C++ Java Python
Interconversions of data types have been discussed many times and have been quite
This task can easily be per formed using the inbuilt function of loads of json librar y of
python which conver ts the string of valid dictionar y into json form, dictionar y in
P ython.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge
Output : that you have read and understood our
Cookie Policy &
Privacy Policy
Got It !
https://www.geeksforgeeks.org/python-convert-string-dictionary-to-dictionary/?ref=lbp 1/5
7/27/22, 9:41 AM Python | Convert string dictionary to dictionary - GeeksforGeeks
Register
The converted dictionary : {'Nikhil': 1, 'Akshat': 2, 'Akash': 3}
The above method can also be used to per form a similar conversion. Function safer
than the eval function and can be used for interconversion of all data types other than
dictionar y as well.
Output :
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge
that you have read and understoodLike
our
Cookie
11
Policy &
Privacy Policy
Got It !
https://www.geeksforgeeks.org/python-convert-string-dictionary-to-dictionary/?ref=lbp 2/5
7/27/22, 9:41 AM Python | Convert string dictionary to dictionary - GeeksforGeeks
Ar ticle Contributed By :
manjeet_04
@manjeet_04
Got It !
Easy Normal Medium Hard Expert
https://www.geeksforgeeks.org/python-convert-string-dictionary-to-dictionary/?ref=lbp 3/5
7/27/22, 9:41 AM Python | Convert string dictionary to dictionary - GeeksforGeeks
Load Comments
Company Learn
About Us Algorithms
Careers Data Structures
In Media SDE Cheat Sheet
Contact Us Machine learning
Privacy Policy CS Subjects
Copyright Policy Video Tutorials
Courses
News Languages
Python
TopyouNews
We use cookies to ensure have the best browsing experience on our website. By using our site, you
acknowledge
Java
that you have read and understood our
Cookie Policy &
Privacy Policy
Technology
Got It ! CPP
Work & Career
https://www.geeksforgeeks.org/python-convert-string-dictionary-to-dictionary/?ref=lbp 4/5
7/27/22, 9:41 AM Python | Convert string dictionary to dictionary - GeeksforGeeks
Business Golang
Start Your Coding
Finance Journey Now!
Login
C#
Register
Lifestyle SQL
Knowledge Kotlin
@geeksforgeeks
, Some rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge
that you have read and understood our
Cookie Policy &
Privacy Policy
Got It !
https://www.geeksforgeeks.org/python-convert-string-dictionary-to-dictionary/?ref=lbp 5/5