Bird
0
0

Consider this simplified incident response code snippet:

medium📝 Analysis Q13 of 15
Cybersecurity - Incident Response
Consider this simplified incident response code snippet:
def respond_to_incident(incident_detected):
    if incident_detected:
        print("Activate response team")
    else:
        print("Monitor systems")

respond_to_incident(True)

What will be the output when this code runs?
AError: undefined variable
BMonitor systems
CNo output
DActivate response team
Step-by-Step Solution
Solution:
  1. Step 1: Analyze the function call

    The function is called with True, so incident_detected is True.
  2. Step 2: Follow the if condition

    Since incident_detected is True, the code prints "Activate response team".
  3. Final Answer:

    Activate response team -> Option D
  4. Quick Check:

    True input triggers activation message [OK]
Quick Trick: True triggers first print statement [OK]
Common Mistakes:
MISTAKES
  • Confusing True with False branch
  • Expecting no output
  • Thinking variable is undefined

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Cybersecurity Quizzes