Search the courses, subjects, tracks, games and features, or jump straight to a page.
4 cards from this section. Quick, good the night before a test.
What is a first-class function?
Think about how functions can be assigned and passed around.
Write a lambda function to increment a number by 1.
Remember the syntax of lambda functions.
What does a higher-order function do?
Think about the role of functions in functional programming.
True or False: A pure function can have side effects.
Consider the definition of a pure function.
Create a higher-order function that takes two functions and a list, applies both functions in order to each element, and returns the modified list.
Think about how to nest function calls within a list comprehension.
Write a pure function that computes the nth Fibonacci number using recursion, and utilize lru_cache to optimize it.
Recursion is key here – consider how Fibonacci numbers are defined!
5 more questions in this section. Enroll free to practise them all.
Enroll free