Create sic.py
Browse files1234567891011121314151617181920212223# Function to calculate simple interestdef calculate_simple_interest(principal, rate, time): """ Calculate the simple interest.
:param principal: The principal amount (P) :param rate: The annual interest rate (R) in percentage :param time: The time period the money is invested or borrowed for (T) in years :return: The simple interest """ interest = (principal * rate * time) / 100 return interest
# Input valuesprincipal = float(input("Enter the principal amount: "))rate = float(input("Enter the annual interest rate (in %): "))time = float(input("Enter the time period (in years): "))
# Calculate simple interestsimple_interest = calculate_simple_interest(principal, rate, time)
# Output the resultprint(f"The simple interest is: {simple_interest}")sic.pyAdded+23