0
0
SCADA systemsdevops~10 mins

Network redundancy (ring topology) in SCADA systems - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to define a ring topology with 4 nodes.

SCADA systems
ring_topology = ['Node1', 'Node2', 'Node3', [1]]
Drag options to blanks, or click blank then click option'
A'Node4'
B'Node6'
C'Node5'
D'Node7'
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing a node name that breaks the sequence.
2fill in blank
medium

Complete the code to add a link between the last and first node to form a ring.

SCADA systems
links = [('Node1', 'Node2'), ('Node2', 'Node3'), ('Node3', 'Node4'), [1]]
Drag options to blanks, or click blank then click option'
A('Node3', 'Node1')
B('Node4', 'Node2')
C('Node4', 'Node1')
D('Node1', 'Node3')
Attempts:
3 left
💡 Hint
Common Mistakes
Connecting nodes that do not close the ring.
3fill in blank
hard

Fix the error in the code to correctly check if the network is a ring.

SCADA systems
is_ring = (len(links) == len(nodes) and links[[1]] == ('Node4', 'Node1'))
Drag options to blanks, or click blank then click option'
A1
B-1
C0
D2
Attempts:
3 left
💡 Hint
Common Mistakes
Using 0 or 1 instead of -1 for the last element.
4fill in blank
hard

Fill both blanks to create a function that returns True if the network is a ring.

SCADA systems
def check_ring(nodes, links):
    return len(links) == len(nodes) and links[[1]] == (nodes[-1], [2])
Drag options to blanks, or click blank then click option'
A-1
Bnodes[0]
Cnodes[1]
Dnodes[-2]
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong indices for last link or first node.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps each node to its next node in the ring.

SCADA systems
next_node = {nodes[[1]]: nodes[[2]] for [3] in range(len(nodes))}
Drag options to blanks, or click blank then click option'
Ai
B(i + 1) % len(nodes)
Dj
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong variable names or forgetting modulo for wrap-around.