SI Calculator Using Python
CREATING A SIMPLE CALCULATOR USING PYTHON.
I am using Pydroid 3 in my Android Phone.
Firstly, I am creating a loop so that when the user finish his first calculation then he can calculate another without going back to screen.
Then I am making three variables ( p, r , t ). In each of the following I am getting input from the user.
And then, I had printed "print (f"Your SI for Rs.{p} at the rate of {r}% in time {t}years is "+ str(int(p)* int(r) * int(t) / 100))"
And then lastly I completed the loop.
Full Code:-
while True:
p = input("Enter Principal(in rupees)")
r = input("Enter Rate% (only numeric value)")
t = input("Enter time (in years)")
print (f"Your SI for Rs.{p} at the rate of {r}% in time {t}years is "+ str(int(p)* int(r) * int(t) / 100))
calculate_another = input("Want to calculate another? (y/n): ")
if calculate_another.lower() != "y":
break
Output:-
Enjoy the given video also:-
Comments
Post a Comment