Exam 350-401 All QuestionsBrowse all questions from this exam
Question 952

DRAG DROP

-

Drag and drop the code snippets from the bottom onto the blanks in the script to convert a Python object into a JSON string. Not all options are used.

    Correct Answer:

Discussion
downturn66

annoys me that the second blank answer is ".encode" when the "." is already in the code snippet. But that's just bad question formatting. The given answer is still correct.

incognitoborg

Given answer is correct >>>json.JSONEncoder().encode({"foo": ["bar", "baz"]}) '{"foo": ["bar", "baz"]}' https://docs.python.org/3/library/json.html

slacker_at_work

The provided Python code defines a dictionary named data containing various pieces of information. Then, it uses the json.JSONEncoder().encode() method to convert this dictionary into a JSON string representation. Finally, it prints the resulting JSON string.

Mizuchan

Seems correct

SeMo0o0o

correct