QuestionQ22

VerifiedFile Processing and Communicating with a Program’s Environment

Which of the following statements about the json.dumps() function are true?

Choose two
Explanation

The Python json module's dumps() function serializes a Python object (such as a dict or list) into a JSON-formatted string. It accepts Python data as its input argument and returns that data encoded as a JSON string — it does not read a JSON string or return a native Python object (that behavior belongs to json.loads(), which parses a JSON string into a Python object).

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!