Simple and compound interest in python



Simple and compound interest calculator in python





#python 3.7.1

print (' ')

print('S.I and C.I calculator')

print(' created by ')

print(' Mr. Dark')

ask = input('choose any option from the below \n 1:- simple interest \n 2:- compound interest \n :- ')

if ask == "1":

  p = float(input("enter principal amount :- "))

  r = float(input("enter rate per annum :-"))

  t = float(input("enter time :-"))

  si = (p*r*t)/100

  print(' ')

  print("simple interest :-", si )

elif ask == "2":

  p = float(input("enter total principal amount :- "))

  r = float(input("enter rate per annum :-"))

  t = float(input("enter time in year :-"))

  print(' ')

  a = p*(1+(r/100))**t

  b = a-p

  print('compound interest :- ', b)

else:

  print("you have choosen wrong option")