class Savings:
def __init__(self, balance, rate):
self.balance = balance
self.rate = rate
def pass_year(self):
self.balance =self.balance * (1 + self.rate)
savings = Savings(1000000, 0.10)
savings.pass_year()
savings.pass_year()
print(savings.balance)
To embed this project on your website, copy the following code and paste it into your website's HTML: