Skip to content

Instantly share code, notes, and snippets.

View mohamedamjad's full-sized avatar

Mohamed Amjad LASRI mohamedamjad

View GitHub Profile
from fastapi import FastAPI
app = FastAPI()
@app.get('/')
def hello():
return {"message": "Hello World!"}
@app.get('/simulation')
def simulation(years: int, capital: float, ir: float):
@mohamedamjad
mohamedamjad / amortissement_pret_bacnaire.py
Created March 30, 2021 08:22
calcul simplifié (probablement faux) d'un tableau d'amortissement
import sys
def annuite(interest_rate, years, capital):
return (capital * interest_rate)/(1 - (1+interest_rate)**-years)
def tableau_amortissement(years, capital, interest_rate):
a = float(format(annuite(interest_rate, years, capital), '.2f'))
capital_debut_periode = capital
print("Annuité du prêt: " + str(a))
for i in range(years):