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

Which data is properly formatted with JSON?

A.

B.

C.

D.

    Correct Answer:

    The correct answer is B. For data to be properly formatted in JSON, it must follow specific syntax rules. JSON objects must have keys enclosed in double quotes, string values must also be enclosed in double quotes, and each key-value pair must be separated by a comma except the last one. In option B, all keys and string values are enclosed in double quotes, and all key-value pairs are correctly followed by a comma except the last one, which adheres to JSON formatting rules. Therefore, option B is the correctly formatted JSON data.

Discussion
netpeer

B is correct as all must end with comma except the last statement before }

RhJ72

netpeer is correct. The question asks for correct json formatting. B is the only answer that has correct json formatting. The question around integer is irrelevant. If you put 25, it's an integer, if you put "25", it's a string. from a formatting perspective, both are correct.

nushadu

A - syntax error - no commas at the end of the lines C - syntax error - "name" value Peter must be a type string (in quotas -> "Peter")

Rockford

B is correct, checked in JSONLint validator numbers 18 and 25 can be in "" or not still valid.

slacker_at_work

To validate JSON { "name":"Peter", "age":"25", "likesJson":true, "characteristics":["small","strong","18"] }

[Removed]

B is correct, there is no need for a comma at end of the last statement

kewokil120

B is correct

nushadu

technically B & D are both correct, I mean Python syntax will not raise any errors ...

nushadu

A - syntax error - no commas at the end of the lines C - syntax error - "name" value Peter must be a type string (in quotas -> "Peter")

Zendahr

B is correct

SeMo0o0o

B is correct

eddgg

b is the right option

John13121

B is valid, verified with JsonValidator...

hsitar

Correct answer should be D

jas26says

the comma at the end makes the answer wrong.

Adeleke

should the age 25 be in quotation???

lukaszr

in quotation 25 is string, without 25 is integer.

Feliphus

No, because it has a final unneeded comma