Answers for "how to calculate simple interest in python"

0

python program for simple interest

 
principle=float(input("Enter the principle amount:"))
time=int(input("Enter the time(years):"))
rate=float(input("Enter the rate:"))
simple_interest=(principle*time*rate)/100
print("The simple interest is:",simple_interest)
Posted by: Guest on February-10-2021
0

simple interest calculator using python

def Interest():                    
    principal = input('Enter the principal: ')
    rate = input('Enter the rate: ')
    time = input('Enter the time: ')
    Simple = ( (int(principal) * int(rate) * int(time)) / int('100'))     #interest formula
    print('S.I. = ' + str(Simple))

def Principal():
    rate = input('Enter the rate: ')
    time = input('Enter the time: ')
    interest = input('Enter the simple interest')
    principal = ( (int('100') * int(interest)) / (int(rate) * int(time)))     #principal formula
    print = ('Principal = ' + str(principal))

def Rate():
    time = input('Enter the time: ')
    interest = input('Enter the simple interest')
    principal = input('Enter the principal: ')
    rate = ( (int('100') * int(interest)) / (int(principal) * int(time)))      #rate formula
    print = ('Rate = ' + str(rate))


def Time():
    interest = input('Enter the simple interest')
    principal = input('Enter the principal: ')
    rate = input('Enter the rate: ')
    time = ( (int('100') * int(interest)) / (int(principal) * int(rate))) #time formula
    print = ('Time = ' + str(time))
    


question = input('What do you want to find: ')

if question == 'interest':        #calls functions if input = the specified string
    Interest()

elif question == 'principal':      
    Principal()

elif question == 'rate':
    Rate()

elif question == 'time':
    Time()

else:
    print('That is not a valid value mate. ')
Posted by: Guest on April-21-2021

Code answers related to "how to calculate simple interest in python"

Python Answers by Framework

Browse Popular Code Answers by Language