Bonjour à tous, étant débutant intégral sur Python pouvez-vous m'aider à résoudre ce problème?![]()
If I have an original placement P in an account with a nominal annual interest rate r , after n years, the total amount of extra money I get (the compound interest) is given by:
I=P×((1+r)^^n − 1)
Write a function compound_interest that takes the original placement, the nominal annual interest rate and a number of years as parameters and returns (not print) the compound interest after these number of years.
Use the assert statement and the isinstance function to check that n is a strictly positive integer, P is positive and r is positive.
Make sure there's a docstring attached to the function that specifies that P is the original placement, r is the nominal interest rate ,n is the number of years the compound interest is computed on.
Je vous en serai très reconnaissant![]()
Partager