Bird
0
0

Given this code:

medium📝 component behavior Q5 of 15
LangChain - Chains and LCEL
Given this code:
lambda_runner = RunnableLambda(lambda x: x * 3)
output = lambda_runner.invoke(4)

What is the value of output?
A4
B12
CError: lambda not callable
D7
Step-by-Step Solution
Solution:
  1. Step 1: Understand lambda function behavior

    The lambda multiplies input by 3, so input 4 becomes 4 * 3 = 12.
  2. Step 2: Apply invoke method

    Calling invoke(4) runs the lambda and returns 12.
  3. Final Answer:

    12 -> Option B
  4. Quick Check:

    RunnableLambda invoke(4) = 12 [OK]
Quick Trick: Invoke runs lambda; 4 * 3 = 12 [OK]
Common Mistakes:
  • Confusing multiplication with addition
  • Expecting input unchanged
  • Assuming lambda is not callable

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LangChain Quizzes