Question
class BankAccount: def __init__ (self, number, owner, balance): self.__number = number self.__owner = owner self.__balance = balance def deposit (self, amount): self.__balance += amount def
class BankAccount:
def __init__ (self, number, owner, balance):
self.__number = number
self.__owner = owner
self.__balance = balance
def deposit (self, amount):
self.__balance += amount
def withdraw (self, amount):
self.__balance -= amount
def get_number(self):
return self.__number
def get_owner (self):
return self.__owner
def get_balance(self):
return self.__balance
1. (4 points) Please answer in PYTHON. Overload the __eq__(self, other) method for the BankAccount class such that if accountA and accountB are instances of the BankAccount class, then the following line can be used in a scrip:
if accountA == accountB :
# do something here
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started