1. Home
  2. Data Science
  3. Python
  4. What does json.dumps() return in Python?

Added 25 Nov 2026

What does json.dumps() return in Python?

  1. A file object
  2. A dictionary
  3. A JSON-formatted string Correct answer
  4. A list

Correct answer

C. A JSON-formatted string

10 views

MCQSEXAM

Explanation

dumps serialises a Python object into a string; dump writes to a file.

Reference

Asked in: Python Interview File Handling

https://docs.python.org/3/tutorial/inputoutput.html

Preparing for an exam?

Doubts & discussion

Not sure why the answer is C? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Python MCQs

Practise all Python MCQs

Similar MCQs