Aryan PrajapatKnowledge Contributor
Write a Python Program for calculating simple interest.
Write a Python Program for calculating simple interest.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Questions | Answers | Discussions | Knowledge sharing | Communities & more.
def calculate_simple_interest(principal, rate, time):
# Simple interest formula: SI = (P * R * T) / 100
simple_interest = (principal * rate * time) / 100
return simple_interest
# Input from the user
principal = float(input(“Enter the principal amount: “))
rate = float(input(“Enter the annual interest rate (in percentage): “))
time = float(input(“Enter the time period (in years): “))
# Calculate simple interest
interest = calculate_simple_interest(principal, rate, time)
# Display the result
print(f”The simple interest for the principal amount ${principal}, annual interest rate of {rate}%, and time period of {time} years is ${interest}.”)