Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to define a star topology where all nodes connect to a central hub.
SCADA systems
topology = {'hub': ['node1', 'node2', 'node3'], 'type': '[1]'} Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing 'ring' or 'bus' which connect nodes differently.
✗ Incorrect
A star topology connects all nodes to a central hub.
2fill in blank
mediumComplete the code to add a new node to a mesh topology.
SCADA systems
mesh_nodes = ['node1', 'node2', 'node3'] mesh_nodes.[1]('node4')
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using remove() or pop() which delete elements.
✗ Incorrect
Use append() to add a new node to the list.
3fill in blank
hardFix the error in the code to correctly check if a node is in a bus topology.
SCADA systems
bus_nodes = ['node1', 'node2', 'node3'] if 'node4' [1] bus_nodes: print('Node found')
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'is' or '==' which compare identity or equality, not membership.
✗ Incorrect
Use 'in' to check membership in a list.
4fill in blank
hardFill both blanks to create a dictionary comprehension mapping nodes to their connection count in a mesh.
SCADA systems
connections = {node: len([1]) for node in [2] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using different node lists causing wrong counts.
✗ Incorrect
Each node connects to all nodes in mesh_nodes, so use mesh_nodes for both.
5fill in blank
hardFill all three blanks to filter nodes with more than 2 connections in the topology dictionary.
SCADA systems
filtered = {node: count for node, count in topology.[1]() if count [2] [3] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using keys() which returns only keys, not pairs.
✗ Incorrect
Use items() to get node-count pairs, then filter counts greater than 2.