JNCIA-DevOps: Juniper Networks Certified Associate – Automation and DevOps — Question 2

You are creating a Python data type that contains a collection of multiple ordered values. As part of your script, you must make changes to the values that are stored in your data type.
In this scenario, which data type should you use?

Answer options

Correct answer: C

Explanation

The correct answer is C, dictionary, because it allows for storing key-value pairs where values can be modified. A list (A) also allows changes but may not be the best fit for key-value pairs. A tuple (B) is immutable, meaning its values cannot be changed, and a set (D) is an unordered collection that does not allow duplicate elements, making it unsuitable for this scenario.