future_value_web.py - \/usr\/bin\/env python from flask import Flask request url_for render_template import locale result = locale.setlocale(locale.LC_ALL

future_value_web.py - /usr/bin/env python from flask...

This preview shows page 1 out of 1 page.

#!/usr/bin/env python from flask import Flask, request, url_for, render_template import locale result = locale.setlocale(locale.LC_ALL, '') if result == 'C': locale.setlocale(locale.LC_ALL, 'en_US') app = Flask(__name__) def calculate_future_value(monthly_investment, yearly_interest_rate, years): monthly_interest_rate = yearly_interest_rate / 12 / 100 months = years * 12 future_value = 0 for i in range(months): future_value = future_value + monthly_investment monthly_interest_amount = future_value * monthly_interest_rate future_value = future_value + monthly_interest_amount return future_value @app.route("/") def show_index(): fv = { "monthly_investment": "", "yearly_interest_rate": "",
Image of page 1

You've reached the end of your free preview.

Want to read the whole page?

  • Summer '19
  • #, @app, 100 months

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture