simple interest calculator using python

Solutions on MaxInterview for simple interest calculator using python by the best coders in the world

showing results for - "simple interest calculator using python"
Elias
08 Sep 2020
1def Interest():                    
2    principal = input('Enter the principal: ')
3    rate = input('Enter the rate: ')
4    time = input('Enter the time: ')
5    Simple = ( (int(principal) * int(rate) * int(time)) / int('100'))     #interest formula
6    print('S.I. = ' + str(Simple))
7
8def Principal():
9    rate = input('Enter the rate: ')
10    time = input('Enter the time: ')
11    interest = input('Enter the simple interest')
12    principal = ( (int('100') * int(interest)) / (int(rate) * int(time)))     #principal formula
13    print = ('Principal = ' + str(principal))
14
15def Rate():
16    time = input('Enter the time: ')
17    interest = input('Enter the simple interest')
18    principal = input('Enter the principal: ')
19    rate = ( (int('100') * int(interest)) / (int(principal) * int(time)))      #rate formula
20    print = ('Rate = ' + str(rate))
21
22
23def Time():
24    interest = input('Enter the simple interest')
25    principal = input('Enter the principal: ')
26    rate = input('Enter the rate: ')
27    time = ( (int('100') * int(interest)) / (int(principal) * int(rate))) #time formula
28    print = ('Time = ' + str(time))
29    
30
31
32question = input('What do you want to find: ')
33
34if question == 'interest':        #calls functions if input = the specified string
35    Interest()
36
37elif question == 'principal':      
38    Principal()
39
40elif question == 'rate':
41    Rate()
42
43elif question == 'time':
44    Time()
45
46else:
47    print('That is not a valid value mate. ')
48