Python for Actuaries

Practice Python programming with actuarial-focused problems and examples.

Problem 1: Calculate Present Value

Easy

Description

Write a function present_value(future_value, interest_rate, years) that calculates the present value of a future amount.

Formula: PV = FV / (1 + r)^n

Example

present_value(1000, 0.05, 10)
# Returns: 613.91

Constraints

  • future_value > 0
  • interest_rate > 0
  • years >= 0
Code Editor
Output

Click "Run" to test your code

Problems