Jump into concepts and practice - no test required
or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Alarm priority levels
📖 Scenario: You are working with a SCADA system that monitors various sensors in a factory. Each alarm has a priority level that helps operators decide which alarms to address first.
🎯 Goal: Build a simple program that stores alarms with their priority levels, sets a threshold priority, filters alarms above that threshold, and displays them.
📋 What You'll Learn
Create a dictionary called alarms with exact alarm names and their priority levels
Create a variable called priority_threshold with an integer value
Use a dictionary comprehension to create a new dictionary high_priority_alarms with alarms having priority greater than priority_threshold
Print the high_priority_alarms dictionary
💡 Why This Matters
🌍 Real World
In SCADA systems, alarms with different priority levels help operators focus on the most critical issues first.
💼 Career
Understanding how to filter and manage alarm priorities is important for roles in industrial automation and system monitoring.
Progress0 / 4 steps
1
Create the alarms dictionary
Create a dictionary called alarms with these exact entries: 'Pump Failure': 5, 'Overheat': 8, 'Power Loss': 9, 'Low Pressure': 3, 'Sensor Fault': 4
SCADA systems
Hint
Use curly braces {} to create a dictionary with keys and values separated by colons.
2
Set the priority threshold
Create a variable called priority_threshold and set it to the integer 5
SCADA systems
Hint
Use a simple assignment to create the variable priority_threshold.
3
Filter high priority alarms
Use a dictionary comprehension to create a new dictionary called high_priority_alarms that includes only alarms from alarms with priority greater than priority_threshold
SCADA systems
Hint
Use {key: value for key, value in dict.items() if condition} to filter the dictionary.
4
Display the high priority alarms
Write a print statement to display the high_priority_alarms dictionary
SCADA systems
Hint
Use print(high_priority_alarms) to show the filtered alarms.
Practice
(1/5)
1. What does the Critical alarm priority level indicate in a SCADA system?
easy
A. An urgent issue that needs immediate attention
B. A minor issue that can be ignored
C. A scheduled maintenance notification
D. A system backup completion message
Solution
Step 1: Understand alarm priority levels
Alarm priorities rank issues by urgency: Low, Medium, High, Critical.
Step 2: Interpret the Critical level meaning
Critical means the most urgent alarm needing immediate action to avoid damage or failure.
Final Answer:
An urgent issue that needs immediate attention -> Option A
Quick Check:
Critical = Immediate attention [OK]
Hint: Critical means highest urgency, act immediately [OK]
Common Mistakes:
Confusing Critical with Low priority
Thinking Critical alarms are routine messages
Ignoring the urgency of Critical alarms
2. Which of the following is the correct way to assign a High priority alarm in a SCADA configuration file?
easy
A. alarm.priority == High
B. alarm.priority : High
C. alarm.priority = High
D. alarm.priority = "High"
Solution
Step 1: Identify correct syntax for string assignment
In configuration files, string values must be assigned with = and quotes.
Step 2: Check each option
alarm.priority = "High" uses = and quotes correctly. alarm.priority == High uses == which is a comparison, not assignment. alarm.priority = High misses quotes. alarm.priority : High uses colon which is invalid here.
Critical is highest priority, so 'Pressure Critical' must be addressed first.
Final Answer:
Pressure Critical -> Option C
Quick Check:
Critical > Medium > Low [OK]
Hint: Handle Critical alarms before others [OK]
Common Mistakes:
Choosing Medium priority over Critical
Treating all alarms equally urgent
Ignoring priority levels in decision
4. You configured an alarm with priority set as alarm.priority = Critical but the system treats it as Low priority. What is the likely cause?
medium
A. Priority value spelled incorrectly
B. Missing quotes around Critical string
C. Alarm is disabled in system settings
D. System does not support Critical priority
Solution
Step 1: Check syntax for priority assignment
Priority values must be strings, so they need quotes.
Step 2: Analyze given assignment
Without quotes, Critical is treated as an undefined variable, defaulting to Low.
Final Answer:
Missing quotes around Critical string -> Option B
Quick Check:
Strings need quotes in config [OK]
Hint: Always quote string values in config files [OK]
Common Mistakes:
Forgetting quotes around string values
Assuming system supports unknown priorities
Ignoring system alarm enable settings
5. In a SCADA system, you want to automatically escalate alarms from Medium to High if not acknowledged within 5 minutes. Which approach best implements this?
hard
A. Set a timer to check unacknowledged Medium alarms and update their priority to High
B. Manually review alarms every hour and change priorities
C. Configure all alarms as High priority from the start
D. Ignore Medium alarms and only monitor High and Critical
Solution
Step 1: Understand escalation requirement
Alarms should automatically increase priority if unacknowledged after 5 minutes.
Step 2: Evaluate options for automation
Set a timer to check unacknowledged Medium alarms and update their priority to High uses a timer to detect and escalate alarms automatically, matching the requirement.
Step 3: Reject other options
Manually review alarms every hour and change priorities is manual and slow. Configure all alarms as High priority from the start ignores priority levels. Ignore Medium alarms and only monitor High and Critical ignores Medium alarms, missing escalation.
Final Answer:
Set a timer to check unacknowledged Medium alarms and update their priority to High -> Option A
Quick Check:
Automate escalation with timer [OK]
Hint: Use timers to auto-escalate unacknowledged alarms [OK]