write a program to calculate simple interest it principal amount,rate of interest and time is given,also calculate the compound interest.
Answers
Answered by
2
p = 696969 #principal amount
r = .07 #7% rate of interest
t = 10 #years
n = 1 #no of times its compounded in a year
simple_interest = p * ( 1 + r * t)
compound_interest = p * (1 + (r / n)) ** (n * t)
print(f"simple: {simple_interest - p}\ncompound: {compound_interest - p}")
Similar questions