easy +5 pts

Simple Interest Calculator

Compute simple interest using principal, rate, and time.

Write a function `simple_interest(principal, rate, time)` that returns the simple interest earned, computed as `principal * rate * time`. - `principal` (float): the initial amount of money. - `rate` (float): the annual interest rate as a decimal (e.g., 0.05 for 5%). - `time` (float): the time period in years. Return the interest as a float. The function should work for non-negative values. Do not round or format the result.

Constraints

All inputs are non-negative floats or integers. Time can be fractional. The result will be within 0 and 1e12. No special cases for zero or negative inputs needed.

Example

>>> simple_interest(1000, 0.05, 2)
100.0
>>> simple_interest(500, 0.1, 1.5)
75.0
>>> simple_interest(0, 0.2, 10)
0.0
5 points ~5 min

Recent Submissions

No submissions yet — hit Run Tests to try!

Hints

Use multiplication: principal times rate times time.
The order of multiplication does not matter.
Return the result directly; no rounding is needed.
Python 3
All tests passed!
Test Results
Press Ctrl+Enter or click Run Tests to execute your code.