In Python, the variables outside the class method are called attributes, and the variables within the class method are called fields. Their private public access methods are similar.
Code is as follows
__name= “private property”
Print (C.__name) # private fields in the derived class can’t access the parent class
Method and attribute access are similar in the above way, that is, the private member can only be used within the class