KunaalNaik's picture
Create app.py
cb05ecd verified
raw
history blame contribute delete
902 Bytes
import streamlit as st
import pandas as pd
# Set the title of the application
st.title("Investment Growth Calculator")
# Sidebar inputs
st.sidebar.header("Investment Parameters")
investment_amount = st.sidebar.number_input("Investment Amount (INR)", min_value=100, value=3000, step=100)
interest_rate = st.sidebar.number_input("Annual Interest Rate (%)", min_value=1.0, value=8.0, step=0.1)
tenure_years = 10
# Calculate the investment growth
data = []
total_amount = investment_amount
for year in range(1, tenure_years + 1):
total_amount += total_amount * (interest_rate / 100)
data.append({"Year": year, "End-of-Year Amount (INR)": round(total_amount, 2)})
# Convert the data into a DataFrame
result_df = pd.DataFrame(data)
# Display the results
st.header("Investment Growth Table")
st.table(result_df)
st.header("Total Amount After 10 Years")
st.write(f"**INR {total_amount:,.2f}**")