Status update from Del Norte High: All clear
Status update from PATH San Diego: Supplies delivered
PRIORITY: Medical Emergency reported in Poway
STANDARD REPORT: Power Outage reported in Escondido
# Helper procedure returning a Boolean
def check_priority(incident_type):
return incident_type in ["Medical Emergency", "Fire", "Earthquake"]
# Outer procedure handling the dispatch
def dispatch_response(location, incident_type):
is_urgent = check_priority(incident_type)
if is_urgent:
print(f"URGENT DISPATCH: Routing emergency services to {location} for a {incident_type}!")
else:
print(f"STANDARD DISPATCH: Logging {incident_type} in {location} for routine follow-up.")
# Called at least three times with different locations and types
dispatch_response("Escondido", "Medical Emergency")
dispatch_response("Del Norte", "Noise Complaint")
dispatch_response("Poway", "Fire")
URGENT DISPATCH: Routing emergency services to Escondido for a Medical Emergency!
STANDARD DISPATCH: Logging Noise Complaint in Del Norte for routine follow-up.
URGENT DISPATCH: Routing emergency services to Poway for a Fire!