emprunt_annuite_cte.py

Created by thierry-barry

Created on March 06, 2019

589 Bytes

Affiche le tableau de remboursement d’un emprunt dans le cas d’une annuité constante. Saisir le montant du capital emprunté, le taux d’intérêt (5 pour 5%, par exemple) et la durée en année.


from math import *
def e_ann_ct(k,i,n):
  list1=[]
  list2=[]
  list3=[]
  i=i/100
  annuite=round(k*i/(1-pow((1+i),-n)),2)
  annuite=trunc(annuite*100)/100
  j=0
  sint=0
  while j<n:
    interet=round(k*i,2)
    interet=trunc(interet*100)/100
    sint=sint+interet
    amort=annuite-interet
    amort=trunc(amort*100)/100
    list1.append(k)
    list2.append(interet)
    list3.append(amort)
    k=round(k-amort,2)
    k=trunc(k*100)/100
    j=j+1
  for l in range(n):
    print(list1[l],'!',list2[l],'!',list3[l],'!',annuite)
  print ('cout du credit :',sint)

During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:

With the exception of Cookies essential to the operation of the site, NumWorks leaves you the choice: you can accept Cookies for audience measurement by clicking on the "Accept and continue" button, or refuse these Cookies by clicking on the "Continue without accepting" button or by continuing your browsing. You can update your choice at any time by clicking on the link "Manage my cookies" at the bottom of the page. For more information, please consult our cookies policy.