Examveda

What is the purpose of the property decorator in Python?

A. To add properties to classes

B. To remove properties from classes

C. To define a getter method for a class attribute

D. To define a setter method for a class attribute

Answer: Option C

Solution (By Examveda Team)

The property decorator is used to define a getter method for a class attribute.

This Question Belongs to Python Program >> Decorators In Depth

Join The Discussion

Related Questions on Decorators in Depth