How to Calculate the Present Value using Python

You can use the following template to calculate the Present Value using Python:

FV = Future Value
r = Interest Rate
n = Number of Periods

PV = FV/(1+r/100)**n
print (PV)

Steps to Calculate the Present Value using Python

Step 1: Gather your Data

To start, you’ll need to gather the data for the Present Value calculation.

For example, let’s say that you collected the following data:

  • Future Value (FV) = 1000
  • Interest Rate (r) = 4%
  • Number of Periods (n) = 7

Step 2: Calculate the Present Value

Next, you can use the template below in order to calculate the Present Value in Python:

FV = Future Value
r = Interest Rate
n = Number of Periods

PV = FV/(1+r/100)**n
print (PV)

This is the complete Python code that you may use for our example:

FV = 1000
r = 4
n = 7

PV = FV/(1+r/100)**n
print (PV)

Run the code in Python and you’ll get the PV of 759.917