How to convert a list to a JSON array in Python

Converting a list to a JSON array returns that list as a JSON string. For example, converting [“1”, “2”, “3”] to a JSON array results in the string ‘[“1”, “2”, “3”]’.

Solution for How to convert a list to a JSON array in Python : You can use json.dumps() to convert a list to a JSON array Call json.dumps(obj) to convert a list obj to a JSON array.


how-to-convert-a-list-to-a-json-array-in-python