Spaces:
Sleeping
Sleeping
Commit
·
f9f202b
1
Parent(s):
ae56f01
app commit
Browse files
app.py
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import math
|
2 |
+
import gradio as gr
|
3 |
+
def loan_emi(amount, duration,rate, down_payment= 0):
|
4 |
+
try:
|
5 |
+
loan_amount = amount - down_payment
|
6 |
+
emi = loan_amount * rate * ( (1+rate) ** duration) / (((1+rate) ** duration ) -1)
|
7 |
+
emi = math.ceil(emi)
|
8 |
+
except ZeroDivisionError:
|
9 |
+
emi = 1 /duration
|
10 |
+
return emi
|
11 |
+
|
12 |
+
|
13 |
+
|
14 |
+
emi = loan_emi(500000, 1*12, 0.1/12, 100000)
|
15 |
+
print(emi)
|
16 |
+
|
17 |
+
iface = gr.Interface(fn = loan_emi, inputs= ["number","number","number","number"], outputs=["text"])
|
18 |
+
iface.launch(share=True)
|