Bird
0
0

Given the code:

medium📝 Predict Output Q4 of 15
LangChain - LangGraph for Stateful Agents
Given the code:
nodeA = Node('A')
nodeB = Node('B')
edge = Edge(nodeA, nodeB)
print(edge.start.name)

What will be printed?
AA
BB
CEdge
DError
Step-by-Step Solution
Solution:
  1. Step 1: Understand the Edge constructor parameters

    Edge(nodeA, nodeB) creates an edge from nodeA to nodeB.
  2. Step 2: Access the start node's name

    edge.start refers to nodeA, so edge.start.name is 'A'.
  3. Final Answer:

    A -> Option A
  4. Quick Check:

    edge.start.name = 'A' [OK]
Quick Trick: Edge(start, end) stores nodes in order [OK]
Common Mistakes:
MISTAKES
  • Confusing start and end nodes
  • Expecting edge to print its own name
  • Assuming edge has no start property

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LangChain Quizzes