0
998views
Write a python program to create a plotting of years of compounding v/s value of principal using the pyplot library. Assume reasonable values for principal, interest rate, and years.
1 Answer
0
58views

Solution:

python program to create a plotting of years of compounding:

This python program calculates simple and compound interest where the principal amount, rate and time are given by the user.

enter image description here

Output:

enter image description here

Python program to compute the future value of a specified principal amount, rate of interest, and a number of years:

The formula for future value with compound interest is FV = P (1 + r/n)^nt.

FV = the future value;

P = the principal;

r = the annual interest rate expressed as a decimal;

n = the number of times interest is paid each year;

t = time in years.

Test Data : amt = 20000, int = 4.5, years = 10

Expected Output: 31059.39.

Input:

enter image description here

Output:

enter image description here

Please log in to add an answer.