Ottosen commited on
Commit
170ff0d
·
1 Parent(s): 7f6f97b

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -0
app.py ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ portion_down_payment = 0.25
4
+ current_savings = 0
5
+ r = 0.05
6
+ monthly_r = r / 12
7
+ monthly_salary = annual_salary / 12
8
+ months = 0
9
+
10
+ def greet(months):
11
+ while current_savings <= total_cost * portion_down_payment:
12
+ current_savings = current_savings * (1 + monthly_r) + monthly_salary * portion_saved
13
+ months += 1
14
+ return "Number of months " + str(months) + "!"
15
+
16
+ demo = gr.Interface(
17
+ fn=greet,
18
+ inputs=gr.Textbox(lines=4, placeholder="Name Here...", label="Your name"),
19
+ outputs="text",
20
+ )
21
+
22
+ demo.launch()