0

How to convert JSON object into string using python. Can any one help? I need this object to be converted into string.

products = [
    {'id':01,'description':'Hair tonic','price':'$20'},
    {'id':02,'description':'Hair Shampoo','price':'$25'},
    {'id':03,'description':'Hair Comb','price':'$10'},
]

1 Answer 1

2
import json
json.dumps(products)

http://docs.python.org/2/library/json.html

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.