Bird
0
0

What is wrong with this code?

medium📝 Debug Q7 of 15
LangChain - LangGraph for Stateful Agents
What is wrong with this code?
node1 = Node('A')
node2 = Node('B')
edge = Edge(node1, node2)
print(edge.start)
AEdge constructor is missing parameters
BNode names must be integers
Cedge.start returns a Node object, not a string
Dprint cannot output node objects
Step-by-Step Solution
Solution:
  1. Step 1: Understand what edge.start returns

    edge.start returns the Node object, not its name string.
  2. Step 2: Recognize print output type

    Printing edge.start will show object info, not the node's name.
  3. Final Answer:

    edge.start returns a Node object, not a string -> Option C
  4. Quick Check:

    edge.start = Node object [OK]
Quick Trick: Use edge.start.name to print node name [OK]
Common Mistakes:
MISTAKES
  • Expecting edge.start to be a string
  • Missing .name when printing node
  • Assuming print can't show objects

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LangChain Quizzes