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 lessonWhat 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
- Sort by Last CharacterBeginner
- Filter and TransformIntermediate
- Sort Students by GPAIntermediate
- Sort Words by LengthAdvanced
All Python exercises · 50 practice problems · Functions quiz