In Python, I am trying to assigne a value to a variable in one method and then add a another value to the same variable in another method. Both methods are within the same class. Here is what I am trying to achieve:
class Account_Balance(Account_General):
def __init__(self, first_name, middle_name, last_name, PIN, DoB, city, address, phone_number, email):
super().__init__(first_name, middle_name, last_name, PIN, DoB, city, address, phone_number, email)
def account_balance(self):
self.balance = 10.0
return self.balance
def account_deposite(self, amount):
self.amount = amount
self.balance += self.amount
The output is: Attribute Error: 'Account_Balance' object has no attribute 'balance'
Where do you think I am getting it wrong? Thank you!