Search the courses, subjects, tracks, games and features, or jump straight to a page.
3 cards from this section. Quick, good the night before a test.
What function in functools allows you to fix certain arguments?
Think of it as a way to create new functions with preset options.
What is the main function of lru_cache?
It's a performance optimization technique.
What does the partial function do in functools?
Think about how it can help reduce the number of parameters you need to pass.
True or False: lru_cache is only applicable to non-recursive functions.
Recall the example of the Fibonacci function.
Construct a decorated Fibonacci function using lru_cache and analyze its performance compared to a non-cached version.
Measure execution time for n = 35 and n = 40.
Create a set of overloaded functions using singledispatch that handles three different data types in calculations. Provide examples of how each function works.
Use @singledispatch for the main function and register for each type.
4 more questions in this section. Enroll free to practise them all.
Enroll free