Complete the code to define a redundant system component.
component_status = 'active' if [1] else 'standby'
The primary component is active while the backup is on standby to prevent downtime.
Complete the code to switch to backup if primary fails.
if not primary_component.is_operational(): [1].activate()
If the primary component fails, the backup component activates to keep the system running.
Fix the error in the redundancy check condition.
if [1].status == 'failed' and backup_component.status == 'ready': backup_component.activate()
The condition must check if the primary component has failed before activating the backup.
Fill both blanks to create a monitoring loop for redundancy.
while system.is_running(): if [1].status == 'failed': [2].activate()
The loop checks if the primary component failed and activates the backup component to prevent downtime.
Fill all three blanks to define a failover function for redundancy.
def failover(): if [1].status == 'failed': [2].activate() log('Switched to [3]')
The function checks if the primary failed, activates the backup, and logs the switch to backup.
