ENAUTO Exam QuestionsBrowse all questions from this exam

ENAUTO Exam - Question 4


Refer to the exhibit. The task is to create a Python script to display an alert message when a Meraki MX Security Appliance goes down. The exhibit shows sample data that is received. Which Python snippet displays the device name and the time at which the switch went down?

A.

B.

C.

D.

Show Answer
Correct Answer:

The correct answer is C. To access the values from a dictionary in Python, you should use square brackets with the key name inside. In this case, `return_val` is a dictionary, and to access the 'deviceName' and 'occurredAt' values from it, you should use `return_val['deviceName']` and `return_val['occurredAt']`. The correct code snippet is: print("The Switch: " + return_val['deviceName'] + ", went down at: " + return_val['occurredAt']).

Discussion

8 comments
Sign in to comment
1234567J
Jan 7, 2021

answer is C

TheNetworkStudent
Jan 21, 2021

entered all code in pycharm, C is the only one that works, the exhibit is a dict and that's the only way to get out the values in a print statement

Trying
Jun 9, 2021

C is correct... Not sure who answered these questions. It's unfortunate that these sites sell the questions with incorrect answers.

catia12
Mar 13, 2021

It should be C but that last " should not be there

Lyndongarcia09
Jan 25, 2022

Answer is C

ThePokemonNuzlockingMaster
Feb 4, 2024

I agree with Catia12, the answer is most definitely C but there is a typo as the final " in the first line should not be there. I'm sure this wouldn't be present in the real exam

[Removed]
Sep 3, 2024

B is correct answer.

Balkancruiser
Jan 26, 2025

B looks like some sort of quasi class utilisation and here we have a dictionary, the proper way to work with a dictionary is shown in C Correct answer is C.