Complete the code to create a lambda function that adds 5 to its input.
add_five = lambda x: x [1] 5 print(add_five(10))
The lambda function adds 5 to the input using the + operator.
Complete the code to create a lambda function that returns True if a number is even.
is_even = lambda n: n [1] 2 == 0 print(is_even(4))
The modulo operator % gives the remainder. If remainder is 0 when divided by 2, the number is even.
Fix the error in the lambda function that should multiply input by 3.
triple = lambda x: x [1] 3 print(triple(7))
The multiplication operator * is needed to multiply the input by 3.
Fill in the blank to create a lambda that returns True if a word's length is greater than 4.
check_length = lambda word: len(word) [1] 4 print(check_length('hello'))
The operator > checks if the length is greater than 4.
Fill all three blanks to create a lambda that filters numbers greater than 10 and doubles them.
result = list(filter(lambda x: x [1] 10, map(lambda x: x [2] [3], [5, 12, 7, 15]))) print(result)
The lambda filters numbers greater than 10 using >, then doubles them by multiplying by 2.