QuestionQ102

Automation and AI

Refer to the exhibit.

Question Image

A Cisco engineer is examining how a dictionary works with key-value pairs in a Python script that processes device records collected from a wireless controller. The engineer reviews the script’s construction to interpret the sequence used to extract data. Which element performs this interaction within the script?

  • A pop operation
  • B import function
  • C get() method
  • D format expression
Explanation

The get() method retrieves a dictionary value by its key and can supply a default value when the key is absent. Here, device.get("macAddress", "N/A") and device.get("ipAddress", "N/A") extract the corresponding values from each device record.

Community Discussion

No comments yet. Be the first to start the discussion!