Your task is to implement a tiny boundary-matching helper.
Goal:
Implement a function edges_match(left, right) that returns true if left.right equals right.left.
Inputs:
left and right are objects that expose boundary strings. They can be either Python objects with attributes .left and .right, or dictionaries with keys "left" and "right".
Deliverables:
A Python file edges.py containing:
def edges_match(left, right): ...
A small self-contained demonstration under if name == "main": that prints the result for a sample pair.
Example test:
left = {"right": "AB"}
right = {"left": "AB"}
print(edges_match(left, right)) # True
How to run:
Run: python3 edges.py
You should see True printed for the sample pair above.
Notes:
Favor a robust approach that works for both dicts and simple objects.
No external dependencies.
Deliverables details:
The final repository should contain at least edges.py with the function and a small demonstration.