Exercises on Python Lambda Functions

The following exercises cover Lambda Functions in Python.

Exercise 1

Create a lambda function, that has one parameter: a, and returns its incremented value.

x =  a :  + 1
Submit Answer
↻ Reset
Show Answer
Fill the fields with missing code.

Exercise 2

Create a lambda function, that has two parameters, and return their product.

x =  a,b : a * 
Submit Answer
↻ Reset
Show Answer
Fill the fields with missing code.

Exercise 3

Create a lambda function, that has no parameters, and always return an integer value of 10.

ten =  : 
Submit Answer
↻ Reset
Show Answer
Fill the fields with missing code.

Exercise 4

Create a lambda function, that has two parameters, and returns the largest of these two, using if else in Lambda functions.

largest = lambda a,b: a  a>b  b
Submit Answer
↻ Reset
Show Answer
Fill the fields with missing code.