Python Programming, Python Data Structures, Oop Concepts, Learn Python, Python Interview.
self.__balance -= amount def get_balance(self): return self.__balance account1 = BankAccount("12345", 1000) account1.deposit(500) account1.withdraw(200) print(account1.get_balance()) # Output: 1300 The account number and balance properties are encapsulated in this example by making them private