What is the difference between public, protected, and private attributes in Python?
Python > Inheritance in Python > Inheritance in Python
344
Answer:
Answer: Public attributes can be accessed and modified from anywhere in the program. Protected attributes can only be accessed and modified by the class and its subclasses. Private attributes can only be accessed and modified by the class, and not its subclasses or other modules.
This Particular section is dedicated to Question & Answer only. If you want learn more about Python. Then you can visit below links to get more depth on this subject.
Join Our telegram group to ask Questions
Click below button to join our groups.