Industry-relevant training in Business, Technology, and Design to help professionals and graduates upskill for real-world careers.
Fun, engaging games to boost memory, math fluency, typing speed, and English skillsβperfect for learners of all ages.
Enroll to start learning
Youβve not yet enrolled in this course. Please enroll for free to listen to audio lessons, classroom podcasts and take mock test.
Test your understanding with targeted questions related to the topic.
Question 1
Easy
What function in functools allows you to fix certain arguments?
π‘ Hint: Think of it as a way to create new functions with preset options.
Question 2
Easy
What is the main function of lru_cache?
π‘ Hint: It's a performance optimization technique.
Practice 4 more questions and get performance evaluation
Engage in quick quizzes to reinforce what you've learned and check your comprehension.
Question 1
What does the partial function do in functools?
π‘ Hint: Think about how it can help reduce the number of parameters you need to pass.
Question 2
True or False: lru_cache is only applicable to non-recursive functions.
π‘ Hint: Recall the example of the Fibonacci function.
Solve and get performance evaluation
Push your limits with challenges.
Question 1
Construct a decorated Fibonacci function using lru_cache and analyze its performance compared to a non-cached version.
π‘ Hint: Measure execution time for n = 35 and n = 40.
Question 2
Create a set of overloaded functions using singledispatch that handles three different data types in calculations. Provide examples of how each function works.
π‘ Hint: Use @singledispatch for the main function and register for each type.
Challenge and get performance evaluation