Here is an example:
class ExpensesCalculator:
__max_number_of_people = 3
def __init__(self):
pass
if __name__ == "__main__":
calculator = ExpensesCalculator()
calculator._ExpensesCalculator__max_number_of_people = 24
print(calculator._ExpensesCalculator__max_number_of_people)
As we can see, the private variable "__max_number_of_people" is accessible outside the class with "calculator._ExpensesCalculator__max_number_of_people".
So, what's the use of making that variable private if it can still be modified outside the class in the way described above?
Why are private variables "masked" instead of being made "private" in Python?