Challenge: Write Your First Decorator
ã¡ãã¥ãŒã衚瀺ããã«ã¯ã¹ã¯ã€ãããŠãã ãã
You have already learned that a decorator in Python is a function that takes another function as its argument and returns a new function that can add extra behavior before or after the original function runs. Decorators are applied using the @decorator_name syntax directly above the function definition. This allows you to modify or enhance functions in a reusable way, without changing their actual code.
ã¹ã¯ã€ãããŠã³ãŒãã£ã³ã°ãéå§
Create a decorator called print_status that wraps any function so that it prints "Function started" before calling the function and "Function ended" after the function finishes. The decorator must work with functions that accept any number of arguments.
è§£ç
ãã£ãŒãããã¯ããããšãããããŸãïŒ
single
AIã«è³ªåãã
AIã«è³ªåãã
äœã§ã質åããããææ¡ããã質åã®1ã€ã詊ããŠãã£ãããå§ããŠãã ãã