Calculating IRR and NPV with different project lifespans
Now that you calculated the WACC, you can calculate and compare the IRRs and NPVs of each project.
While the IRR remains relatively comparable across projects, the NPV, on the other hand, will be much more difficult to compare given the additional year required for project 1.
Luckily, in the next exercise, we will introduce another method to compare the NPVs of the projects, but we will first need to compute the NPVs as before.
The cash flows for projects 1 and 2 are available as cf_project1
and cf_project2
.
This exercise is part of the course
Introduction to Financial Concepts in Python
Exercise instructions
- Compute and print the IRR of each project.
- Set the WACC equal to 12.9%
- Compute and print the NPV of each project.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
import numpy as np
# Calculate the IRR for Project 1
irr_project1 = ____
print("Project 1 IRR: " + str(round(100*irr_project1, 2)) + "%")
# Calculate the IRR for Project 2
irr_project2 = ____
print("Project 2 IRR: " + str(round(100*irr_project2, 2)) + "%")
# Set the wacc equal to 12.9%
wacc = ____
# Calculate the NPV for Project 1
npv_project1 = ____
print("Project 1 NPV: " + str(round(npv_project1, 2)))
# Calculate the NPV for Project 2
npv_project2 = ____
print("Project 2 NPV: " + str(round(npv_project2, 2)))