Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to define the main screen in the SCADA system.
SCADA systems
main_screen = Screen(name=[1]) Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting to put quotes around the screen name
Using variable names without quotes
✗ Incorrect
The screen name must be a string, so it needs to be enclosed in quotes.
2fill in blank
mediumComplete the code to add a child screen to the main screen.
SCADA systems
main_screen.add_child([1]) Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Passing the screen name as a string instead of the screen object
Using quotes around the variable name
✗ Incorrect
The add_child method expects a Screen object, so the variable name without quotes is correct.
3fill in blank
hardFix the error in the code to navigate to a screen by its name.
SCADA systems
navigate_to_screen([1]) Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Passing variable names without quotes
Using single quotes instead of double quotes if the system requires double quotes
✗ Incorrect
The function expects the screen name as a string, so it must be in quotes.
4fill in blank
hardFill both blanks to create a screen hierarchy with a parent and child screen.
SCADA systems
parent_screen = Screen(name=[1]) parent_screen.add_child([2])
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using variable names without quotes for screen names
Putting quotes around the child screen variable
✗ Incorrect
The parent screen name must be a string, and the child screen is a variable passed without quotes.
5fill in blank
hardFill all three blanks to define a screen dictionary with screen names as keys and screen objects as values, filtering only active screens.
SCADA systems
active_screens = { [1]: [2] for [1] in screens if screens[[1]].[3] } Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using inconsistent variable names for keys and values
Checking wrong attribute for active status
✗ Incorrect
Use 'screen_name' as the key variable, 'screens[screen_name]' as the value, and check the 'is_active' attribute.