Write a class named "BankAccount" with the following attributes: id, currency and balance. The class has a constructor with only two of the attributes: id and currency. The value of the currency, if omitted, has a default value "EUR0". The third attribute by default is zero. We suppose that when we activate a bank account its balance is initially empty.
class BankAccount():
def __init__(self, id, currency = 'EUR0'):
self.id = id
self.currency = currency
self.balance = 0
a = BankAccount(123)
hope you meant that
Comments
Leave a comment