simple interest calculator python code code example
Example: 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'))
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)))
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)))
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)))
print = ('Time = ' + str(time))
question = input('What do you want to find: ')
if question == 'interest':
Interest()
elif question == 'principal':
Principal()
elif question == 'rate':
Rate()
elif question == 'time':
Time()
else:
print('That is not a valid value mate. ')