Write a decorator called 'double_result' that doubles the return value of any function it wraps
A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- medium
Problem
Write a decorator called 'double_result' that doubles the return value of any function it wraps. Apply it to a function called 'add' that takes two parameters and returns their sum. Call add(3, 4) and print the result.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and grades it automatically.