32 AnswersNew Answer
32 AnswersNew Answer
Ejeh Joseph , nice code! just some comments from me: ▪︎before asking the first input, all input options should be shown: Options: - Simple Interest (si) - Principal (pr) - Time (ti) - Rate (ra) What do you want to calculate? - ▪︎there are only 4 inputs needed for the calculation, but each of them occurs multiple times as a code line. try to find a way without this duplicating. happy coding and good success!
It's a simple equation. Do you know how to make a variable say x as the subject of the equation?
Allan 🔥STORMER🔥🔥🔥🔥 your code will also work fine here. But you need to provide input together line by line like 1000 10 2 It will output 200.00
Ejeh Joseph Your Highness, I will do the needful when I get the Time 😉
Try running this on computer, doesn't work well on sololearn app https://code.sololearn.com/caEe8zo23j3y/?ref=app
Ejeh Joseph there is no built in function in python to get SI directly as per my knowledge...but you can do less code to minimise your input and output part....like you can take all 3 inputs in once P,R,T = map(int, input().split()) Formula part and then output result = (P*R*T)/100 print(result)
Ejeh Joseph what do you mean by unknown ...to get a SI you need to provide all three values P and R and T... either by giving constant values or take user input
Sanjay Kamath can you write the code in Python please
Allan 🔥STORMER🔥🔥🔥🔥 review my code again and see....it can also find the principal, time and rate
Allan 🔥STORMER🔥🔥🔥🔥 yes
Do this, Since SI=(P*T*R) /100 Then make P the subject by cross multiplying like this SI*100= P*T*R Then divide both sides by T*R You will get P =( SI*100)/(T*R) Where P=Principle SI= Simple Interest T= Time R= Rate
Allan 🔥STORMER🔥🔥🔥🔥 change of subject formula is not the problem... my question is if there is a simplified way of writing the code
sudhir meena thanks, but if I have SI, P, R and T is unknown... how to I do that... that's what I built!!... thanks once again
sudhir meena yes I know that. My question is what if you are given the simple, the principal, the rate and you are ask to find the time
Just a comment, the user don't know its the code for SI, so if you list all the options that if calculates, then user can give the right input except user want to calculate anything like add two numbers, anything like that.
Rojan Shrestha thanks I got that
Sanjay Kamath 😂😂 your highness?? Really?? ....
Can any one send me exact concepts of core java That are used in Intrview???
Sololearn Inc.4 Embarcadero Center, Suite 1455
Send us a message