Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #a function to calculate and return interest amount
- def SimpleInterest(principle_amount, interest_rate, years):
- interest_amount = (principle_amount*interest_rate*years)/100
- return interest_amount
- def main():
- #taking input from user for principle, interest rate, years
- principle_amount = float(input("Enter the principal amount: "))
- interest_rate = float(input("Enter the interest rate: "))
- years = int(input("Enter the number of years: "))
- #calling the previous function and printing it
- print("The interest amount is: " + str(SimpleInterest(principle_amount,interest_rate,years)))
- if __name__ == "__main__":
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement