Bird
0
0

Given this Python Lambda handler code:

medium📝 Predict Output Q13 of 15
AWS - Lambda
Given this Python Lambda handler code:
def handler(event, context):
    return event['value'] * 2

What is the output if the event is {"value": 5}?
AError: 'value' key missing
B5
C10
DNone
Step-by-Step Solution
Solution:
  1. Step 1: Understand the handler logic

    The handler multiplies the 'value' from event by 2.
  2. Step 2: Calculate output for event {'value': 5}

    5 * 2 = 10, so the function returns 10.
  3. Final Answer:

    10 -> Option C
  4. Quick Check:

    5 times 2 equals 10 [OK]
Quick Trick: Multiply event['value'] by 2 for output [OK]
Common Mistakes:
MISTAKES
  • Confusing event keys or missing them
  • Assuming function returns input unchanged
  • Expecting error when key exists

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes