Drill

ProblemsPython › finance

Simple interest earned

easyfinancePython

A saver is told the interest they would earn: principal held for years at a whole-percent annual rate, with no compounding.

simple_interest(principal: int, rate_percent: int, years: int) → int

Solve it in the editor →

Where you start

def simple_interest(principal: int, rate_percent: int, years: int) -> int:
    

Worked examples

CallResult
simple_interest(1000, 5, 2)100
simple_interest(10000, 10, 5)5000
simple_interest(1234, 5, 3)185
simple_interest(2500, 0, 10)0

Hint

Multiply all three, divide and round down.

Reference solution in Python
def simple_interest(principal: int, rate_percent: int, years: int) -> int:
    return principal * rate_percent * years // 100

The same problem in another language

More finance problems in Python