File size: 632 Bytes
95d7349
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import gradio as gr

def emi(principal, rate, tenure):
    rate = rate / (12 * 100)  # Convert annual interest rate to monthly and percentage to decimal
    emi = (principal * rate * (1 + rate) ** tenure) / ((1 + rate) ** tenure - 1)
    return round(emi, 2)


demo = gr.Interface(
  fn=emi,
  inputs=[
  
    gr.Number(label="Loan Amount"),
    gr.Number(label="Rate of interest"),
    gr.Number(label="Loan Tenure (Months)"),
    
  ],
  outputs=gr.Number(label="EMI (Monthly Installment)"),
  title="EMI Calculator",
  description="Enter the loan amount, annual interest rate, and tenure to calculate your EMI."
)  
demo.launch()