Complete the code to generate a basic report showing system status.
report = f"System status: [1]"
The variable status holds the current system status, which is essential for the report.
Complete the code to log the report with a timestamp.
log_entry = f"[1] - Report: {report}"
The timestamp variable records the exact time the report was created, which is important for tracking.
Fix the error in the code that filters alerts for critical severity.
critical_alerts = [alert for alert in alerts if alert.severity [1] 'critical']
= instead of comparison ==.The comparison operator == checks if the alert severity equals 'critical'. Using = causes a syntax error.
Fill both blanks to create a dictionary of sensor readings above threshold.
high_readings = {sensor.id: sensor.value for sensor in sensors if sensor.value [1] [2]We want readings greater than the threshold, so use > and threshold.
Fill all three blanks to build a report dictionary with sensor name, value, and status check.
report = [1]: sensor.name, [2]: sensor.value, [3]: sensor.value > safe_limit
The keys "name", "value", and "is_safe" clearly label the report data.