Editor

Predict the Lambda Output

Beginner · Predict the output · from Python Lambda Functions: When to Use (and When Not To)

From the lesson: Python Lambda Functions: When to Use (and When Not To)

Imagine you need to leave someone a quick note: "Back in 5 minutes." You wouldn't write a formal letter with a greeting, three paragraphs, and a signature. You'd scribble it on a sticky note and be done.

Read the lesson

What does this code print? Type the exact output.

operation = lambda a, b: a * b + 1
print(operation(3, 4))
print(operation(0, 10))
operation = lambda a, b: a * b + 1
print(operation(3, 4))
print(operation(0, 10))

More Lambda exercises

All Python exercises · 50 practice problems · Functions quiz