3.To calculate Simple and Compound interest.

Solution :- 

Static:- 

principal=5000
rate = 4
time = 2

si = principal*rate*time/100
ci = principal*(1+rate/100)**time-principal

print(“Simple interest is :- “,si)
print(“Compound interest is :- “,ci)

Dynamic

principal=float(input(“Enter the principal amount :- “))
rate = float(input(“Enter the rate of interest :- “))
time = float(input(“Enter the time in number of years :- “))

si = principal*rate*time/100
ci = principal*(1+rate/100)**time-principal

print(“Simple interest is :- “,si)
print(“Compound interest is :- “,ci)