Topic Practice · Advanced
Decorators problems
50 problems: 22 Easy, 18 Medium, 10 Hard.
✓1. Functions as Arguments
4 test casesEasy✓2. Function Factory
4 test casesEasy✓3. Shout Decorator
4 test casesEasy✓4. Announce Calls
4 test casesEasy✓5. Count the Calls
4 test casesEasy✓6. Make It Bold
4 test casesEasy✓7. Double the Result
4 test casesEasy✓8. Before and After
4 test casesEasy✓9. Functions Are Values
4 test casesEasy✓10. A List of Functions
4 test casesEasy✓11. A Function Inside a Function
4 test casesEasy✓12. Return a Function
4 test casesEasy✓13. Wrap by Hand
4 test casesEasy✓14. The @ Syntax
4 test casesEasy✓15. Lower-Case Decorator
4 test casesEasy✓16. Plus One Decorator
4 test casesEasy✓17. Print the Function's Name
4 test casesEasy✓18. Pass Any Arguments Through
4 test casesEasy✓19. Wrap in Brackets
4 test casesEasy✓20. Run It Twice
4 test casesEasy✓21. Never Negative
4 test casesEasy✓22. Keep the Docstring
4 test casesEasy✓23. Keep the Name
4 test casesMedium✓24. Repeat Decorator
4 test casesMedium✓25. Validate Arguments
4 test casesMedium✓26. Memoize
4 test casesMedium✓27. lru_cache Speed-up
4 test casesMedium✓28. Log Arguments
4 test casesMedium✓29. Stacked Decorators
4 test casesMedium✓30. Property Decorator
4 test casesMedium✓31. Fallback Value
4 test casesMedium✓32. Decorator With an Argument
4 test casesMedium✓33. Caching Saves Calls
4 test casesMedium✓34. Round the Result
4 test casesMedium✓35. Only Admins Allowed
4 test casesMedium✓36. Turn Errors Into Messages
4 test casesMedium✓37. Keep a Call Log
4 test casesMedium✓38. Default When Nothing Comes Back
4 test casesMedium✓39. Trace a Recursive Function
4 test casesMedium✓40. Clean the Arguments First
4 test casesMedium✓41. Retry Decorator
4 test casesHard✓42. Measure Steps
4 test casesHard✓43. Plugin Registry
4 test casesHard✓44. Type-Checking Decorator
4 test casesHard✓45. Class Decorator
2 test casesHard✓46. Limit the Calls
4 test casesHard✓47. Stacking Tag Decorators
4 test casesHard✓48. Count Calls per Method
4 test casesHard✓49. Convert Arguments From Annotations
4 test casesHard✓50. Your Own LRU Cache
4 test casesHard
4 test casesEasy✓2. Function Factory
4 test casesEasy✓3. Shout Decorator
4 test casesEasy✓4. Announce Calls
4 test casesEasy✓5. Count the Calls
4 test casesEasy✓6. Make It Bold
4 test casesEasy✓7. Double the Result
4 test casesEasy✓8. Before and After
4 test casesEasy✓9. Functions Are Values
4 test casesEasy✓10. A List of Functions
4 test casesEasy✓11. A Function Inside a Function
4 test casesEasy✓12. Return a Function
4 test casesEasy✓13. Wrap by Hand
4 test casesEasy✓14. The @ Syntax
4 test casesEasy✓15. Lower-Case Decorator
4 test casesEasy✓16. Plus One Decorator
4 test casesEasy✓17. Print the Function's Name
4 test casesEasy✓18. Pass Any Arguments Through
4 test casesEasy✓19. Wrap in Brackets
4 test casesEasy✓20. Run It Twice
4 test casesEasy✓21. Never Negative
4 test casesEasy✓22. Keep the Docstring
4 test casesEasy✓23. Keep the Name
4 test casesMedium✓24. Repeat Decorator
4 test casesMedium✓25. Validate Arguments
4 test casesMedium✓26. Memoize
4 test casesMedium✓27. lru_cache Speed-up
4 test casesMedium✓28. Log Arguments
4 test casesMedium✓29. Stacked Decorators
4 test casesMedium✓30. Property Decorator
4 test casesMedium✓31. Fallback Value
4 test casesMedium✓32. Decorator With an Argument
4 test casesMedium✓33. Caching Saves Calls
4 test casesMedium✓34. Round the Result
4 test casesMedium✓35. Only Admins Allowed
4 test casesMedium✓36. Turn Errors Into Messages
4 test casesMedium✓37. Keep a Call Log
4 test casesMedium✓38. Default When Nothing Comes Back
4 test casesMedium✓39. Trace a Recursive Function
4 test casesMedium✓40. Clean the Arguments First
4 test casesMedium✓41. Retry Decorator
4 test casesHard✓42. Measure Steps
4 test casesHard✓43. Plugin Registry
4 test casesHard✓44. Type-Checking Decorator
4 test casesHard✓45. Class Decorator
2 test casesHard✓46. Limit the Calls
4 test casesHard✓47. Stacking Tag Decorators
4 test casesHard✓48. Count Calls per Method
4 test casesHard✓49. Convert Arguments From Annotations
4 test casesHard✓50. Your Own LRU Cache
4 test casesHard