LearnPy Hub
← All topics
Topic Practice · Advanced

Decorators problems

50 problems: 22 Easy, 18 Medium, 10 Hard.

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