Bird
0
0

Consider this code snippet used in an incident report system:

medium📝 Analysis Q13 of 15
Cybersecurity - Incident Response
Consider this code snippet used in an incident report system:
def notify_team(message, urgency):
    if urgency == 'high':
        channel = 'SMS'
    else:
        channel = 'Email'
    return f"Notification sent via {channel}: {message}"

print(notify_team('Server down', 'high'))

What will be the output?
ANotification sent via Email: Server down
BNotification sent via SMS: Server down
CNotification sent via SMS: high
DError: undefined variable channel
Step-by-Step Solution
Solution:
  1. Step 1: Analyze the function logic for urgency 'high'

    If urgency is 'high', channel is set to 'SMS'.
  2. Step 2: Check the return statement with given inputs

    Returns 'Notification sent via SMS: Server down'.
  3. Final Answer:

    Notification sent via SMS: Server down -> Option B
  4. Quick Check:

    Urgency 'high' uses SMS channel [OK]
Quick Trick: High urgency means SMS notification [OK]
Common Mistakes:
MISTAKES
  • Confusing 'high' with 'low' urgency
  • Assuming default channel is SMS
  • Expecting an error due to variable scope

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Cybersecurity Quizzes