Which Python feature would you use to modify the behavior of a function or method?

  • Decorators
  • Encapsulation
  • Inheritance
  • Polymorphism
In Python, decorators are used to modify the behavior of functions or methods. They allow you to add functionality to existing code without modifying its structure. Decorators are often used for tasks like logging, authentication, and more.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *