CCNP 350-401 ENCOR Question 539 DISCUSSION
« Back to Main MenuWhich Python code snippet must be added to the script to save the returned configuration as a JSON-formatted file?
A.
with open(“ifaces.json”, “w”) as OutFile:
OutFile.write(Response.text)
B.
with open(“ifaces.json”, “w”) as OutFile:
OutFile.write(Response.json())
C.
with open(“ifaces.json”, “w”) as OutFile:
JSONResponse = json.loads(Response.text)
OutFile.write(JSONResponse)
D.
with open(“ifaces.json”, “w”) as OutFile:
OutFile.write(Response)
Which Python code snippet must be added to the script to save the returned configuration as a JSON-formatted file?
A.
with open(“ifaces.json”, “w”) as OutFile:
OutFile.write(Response.text)
B.
with open(“ifaces.json”, “w”) as OutFile:
OutFile.write(Response.json())
C.
with open(“ifaces.json”, “w”) as OutFile:
JSONResponse = json.loads(Response.text)
OutFile.write(JSONResponse)
D.
with open(“ifaces.json”, “w”) as OutFile:
OutFile.write(Response)
Correct Answer: B