Quiz 14 Question 14 of 20

An automation engineer reviews a Python inventory script that loops over a list of hostnames, looks each one up in a dictionary of assigned roles, and prints a hostname only when the role equals 'spine'. For inventory {'leaf1': 'leaf', 'spine1': 'spine', 'spine2': 'spine'} and hosts ['leaf1', 'spine1', 'spine2'], which output does the script produce?

Select an answer to reveal the explanation.

Motivation