nerdexam
Cisco

350-401 · Question #553

An engineer must export the contents of the devices object in JSON format. Which statement must be used?

The correct answer is B. json.dumps(Devices). To convert a Python object into a JSON formatted string, the json.dumps() function from the json module is the correct method to use.

Submitted by jaden.t· Mar 6, 2026Automation

Question

An engineer must export the contents of the devices object in JSON format. Which statement must be used?

Options

  • Ajson.repr(Devices)
  • Bjson.dumps(Devices)
  • Cjson.prints(Devices)
  • Djson.loads(Devices)

How the community answered

(36 responses)
  • A
    6% (2)
  • B
    92% (33)
  • C
    3% (1)

Why each option

To convert a Python object into a JSON formatted string, the `json.dumps()` function from the `json` module is the correct method to use.

Ajson.repr(Devices)

There is no standard `json.repr()` function in Python's `json` module; `repr()` is a built-in Python function that returns a developer-friendly string representation of an object, not for JSON serialization.

Bjson.dumps(Devices)Correct

The `json.dumps()` function serializes a Python object (`Devices` in this case) into a JSON formatted string, which is precisely what is needed to export its contents in JSON format.

Cjson.prints(Devices)

There is no `json.prints()` function in Python's standard `json` module; `print()` is a built-in Python function for outputting to the console.

Djson.loads(Devices)

The `json.loads()` function performs the inverse operation, deserializing a JSON formatted string into a Python object, which is not the requirement for exporting an object.

Concept tested: Python JSON serialization (json.dumps)

Source: https://docs.python.org/3/library/json.html#json.dumps

Topics

#Python#json.dumps#JSON serialization#data formatting

Community Discussion

No community discussion yet for this question.

Full 350-401 Practice