Conditional Program Execution

In [2]:
def add_interest(balance, rate):
    new_balance = balance * (1 + rate)
    return new_balance

def main():
    amount = 1000
    rate = 0.05
    amount = add_interest(amount, rate)
    print(amount)
In [3]:
if __name__ == "__main__":
    main()
1050.0
In [ ]: