What does `@property` do when applied to a method?

Python Professional Hard

Python Professional — Hard

What does `@property` do when applied to a method?

Key points

  • `@property` enables method access as an attribute
  • No need to call the method explicitly
  • Enhances code readability and simplicity

Ready to go further?

Related questions