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)- A12% (8)
- B8% (5)
- C77% (50)
- D3% (2)
Community Discussion
No community discussion yet for this question.