AriaEs39 commited on
Commit
892b0e0
1 Parent(s): 9e291ca

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -1
app.py CHANGED
@@ -1,4 +1,18 @@
1
- esent_value = (monthly_payment * 12 / interest_rate) * (1 - (1 / (1 + interest_rate/12)**months))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  # Display the present value
4
  st.write(f"The present value is {present_value:,.2f} using the discrete model")
 
1
+ import streamlit as st
2
+ import numpy as np
3
+ import pandas as pd
4
+ import matplotlib.pyplot as plt
5
+
6
+ # Streamlit app layout
7
+ st.title("Insurance Payment with Savings 💼")
8
+
9
+ # Create the inputs (A, r, n)
10
+ monthly_payment = st.number_input("Desired monthly payment:")
11
+ interest_rate = st.number_input("Interest rate (%):")
12
+ months = int(st.number_input("Number of months:", step=1))
13
+
14
+ # Calculate the present value
15
+ present_value = (monthly_payment * 12 / interest_rate) * (1 - (1 / (1 + interest_rate/12)**months))
16
 
17
  # Display the present value
18
  st.write(f"The present value is {present_value:,.2f} using the discrete model")