Python - Encapsulation and Data Protection
Which of the following is the correct way to define a private attribute named
age in a Python class?age in a Python class?__age.self.__age, which is correct. self.age is public, self._age is protected (single underscore), self.___age has three underscores which is invalid.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions