📅  最后修改于: 2022-03-11 14:46:34.043000             🧑  作者: Mango
# In python access modifying can be done by prefixing the underscore character '_' to the variable name.
# Prefixing no underscores makes the variable public.
# Prefixing 1 underscore makes the variable protected.
# Prefixing 2 underscores makes the variable private.
# In the following example, name is public, __make is private, _model is protected.
class Car:
def __init__(self):
print("Engine started")
self.__make = "toyota"
self._model = 1999
self.name = "corolla"