What are accessors, mutators, and @property?



What are accessors, mutators, and @property?..

Answer / Abhishek Kumar Jha

In object-oriented programming, accessors (also known as getters) are methods that retrieve the value of an attribute, while mutators (also known as setters) are methods that modify the value of an attribute. The `@property` decorator in Python allows you to create automatic accessor and mutator methods for attributes.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Python Interview Questions

What is speech_recognition? Does this ship with python by default?

1 Answers  


What is python inheritance?

1 Answers  


How will you check in a string that all characters are digits?

1 Answers  


How will you convert a string to all lowercase?

1 Answers  


How is numpy different from scipy?

1 Answers  


What is pypi repository?

1 Answers  


How do I use strftime in python?

1 Answers  


What is type () in python?

1 Answers  


Explain delegation in python

1 Answers  


What is the zip() function in python?

1 Answers  


How can you keep track of different versions of code?

1 Answers  


Is python a good first language?

1 Answers  


Categories