nerdexam
Juniper

JN0-223 · Question #52

Which Python code block is an example of a context manager?

The correct answer is C. with Device(host="vmx-1", user="lab", passwd="lab123") as device. See the full explanation below for the reasoning.

Question

Which Python code block is an example of a context manager?

Options

  • Awhile True:
  • Btry:
  • Cwith Device(host="vmx-1", user="lab", passwd="lab123") as device:...
  • Dfor host in ["vmx-1", "vmx-2"]:

How the community answered

(65 responses)
  • A
    12% (8)
  • B
    8% (5)
  • C
    77% (50)
  • D
    3% (2)

Community Discussion

No community discussion yet for this question.

Full JN0-223 Practice