Search the courses, subjects, tracks, games and features, or jump straight to a page.
2 cards from this section. Quick, good the night before a test.
Define a simple lambda function that adds two numbers.
Think about how you would write a simple addition operation.
What would lambda x: x + 2 return when called with 3?
Evaluate the expression inside the lambda with the given input.
What is a lambda function?
Think about its characteristics.
Lambda functions can accept multiple arguments. True or False?
Recall the syntax of lambda functions.
Create a function using a lambda expression that checks if a number is even or odd.
Remember the modulus operator returns the remainder.
Write a code block that generates a list of cubes for numbers from 1 to 10 using a lambda function and mapping.
Think about how you can iterate over a range.
4 more questions in this section. Enroll free to practise them all.
Enroll free