diff --git a/marimo-notebook/README.md b/marimo-notebook/README.md new file mode 100644 index 0000000000..afe3da6280 --- /dev/null +++ b/marimo-notebook/README.md @@ -0,0 +1,24 @@ +The materials contained in this download are designed to complement the Real Python tutorial [Marimo: A Reactive, Reproducible Notebook](https://realpython.com/marimo-notebook-reactive-reproducible/). + +You should create a new folder named marimo on your computer and place each of these files inside it. You might also consider creating a [Python virtual environment](https://realpython.com/python-virtual-environments-a-primer/) within this folder. + +Your download bundle contains the following files: + +hypotenuse_calculator.py - This file contains the original hypotenuse_calculator code +hypotenuse_calculator_before_update.py - This file contains the code before any updating is attempted. The code has been deliberately placed out of order, however it runs cleanly. +hypotenuse_calculator_duplicate_variable.py - This file shows the effect of re-defining a variable. This file produces an error. +hypotenuse_calculator_after_update.py - This file contains the code after the `adjacent` variable was updated to `10`. This file runs cleanly. +hypotenuse_calculator_after_deletion.py - This file contains the code after the `opposite variable` was deleted. This file produces an error. + +break_even_analysis_chart_code.py - This file contains the basic chart code. It will produce a break-even analysis for a fixed set of input data. +break_even_analysis_UI_elements.py - This file contains includes the four UI interface elements to allow the plot to be adjusted. +break_even_analysis_solution.py - This file contains a possible solution to the skills test. + +packages.py - This file contains the code used to demonstrate sandboxing. +quadratic.py - This file contains the marimo notebook version of the quadratic formula example. +equation.py - This file contains the Python script version of quadratic.py. + +simultaneous_equations.py - This file contains the code used to demonstrate marimo's UI elements. +simultaneous_equations_ui.py - This file contains a possible solution to the challenge skills test. + +hidden_state.ipynb - This file contains a Jupyter Notebook that can be used as a starting point for the investigation of its problems. You should adjust it as instructed in the tutorial. diff --git a/marimo-notebook/break_even_analysis_UI_elements.py b/marimo-notebook/break_even_analysis_UI_elements.py new file mode 100644 index 0000000000..832636dabf --- /dev/null +++ b/marimo-notebook/break_even_analysis_UI_elements.py @@ -0,0 +1,113 @@ +# flake8: noqa + +import marimo + +__generated_with = "0.11.0" +app = marimo.App(width="medium") + + +@app.cell +def _(): + import matplotlib.pyplot as plt + import marimo as mo + + return mo, plt + + +@app.cell +def _(ui_fixed_cost, ui_quantity, ui_selling_price, ui_unit_cost): + fixed_cost = int(ui_fixed_cost.value) + unit_cost = ui_unit_cost.value + selling_price = float(ui_selling_price.value) + upper_production_quantity = ui_quantity.value + return fixed_cost, selling_price, unit_cost, upper_production_quantity + + +@app.cell +def _( + fixed_cost, + plt, + selling_price, + ui_color_costs, + unit_cost, + upper_production_quantity, +): + break_even_quantity = fixed_cost / (selling_price - unit_cost) + break_even_income = break_even_quantity * selling_price + + units = range(0, upper_production_quantity + 1, 1000) + unit_costs = [(unit * unit_cost) + fixed_cost for unit in units] + sales_income = [unit * selling_price for unit in units] + + plt.plot(units, unit_costs, marker="o", color=ui_color_costs.value) + plt.plot(units, sales_income, marker="x") + + plt.xlabel("Units Produced") + plt.ylabel("($)") + plt.legend(["Total Costs", "Total Income"]) + plt.title("Break-Even Analysis") + + plt.vlines( + break_even_quantity, + ymin=0, + ymax=break_even_income, + linestyles="dashed", + ) + plt.text( + x=break_even_quantity + 100, + y=int(break_even_income / 2), + s=int(break_even_quantity), + ) + plt.grid() + plt.show() + return ( + break_even_income, + break_even_quantity, + sales_income, + unit_costs, + units, + ) + + +@app.cell +def _(mo): + ui_fixed_cost = mo.ui.radio(options=["40000", "50000"], value="50000") + + ui_unit_cost = mo.ui.slider(start=2, stop=5, step=1) + + ui_selling_price = mo.ui.text(value="10") + + ui_quantity = mo.ui.dropdown( + options={"10000": 10000, "12000": 12000, "15000": 15000}, + value="10000", + ) + + ui_disply_break_even = mo.ui.switch() + + ui_color_costs = mo.ui.dropdown( + options={"Red": "red", "Green": "green", "Blue": "blue"}, value="Red" + ) + + mo.md( + f""" + Fixed Costs: {ui_fixed_cost} + + Unit Cost Price: {ui_unit_cost} + + Selling Price: {ui_selling_price} + + Maximum Production Quantity: {ui_quantity} + """ + ) + return ( + ui_color_costs, + ui_disply_break_even, + ui_fixed_cost, + ui_quantity, + ui_selling_price, + ui_unit_cost, + ) + + +if __name__ == "__main__": + app.run() diff --git a/marimo-notebook/break_even_analysis_chart_code.py b/marimo-notebook/break_even_analysis_chart_code.py new file mode 100644 index 0000000000..1ca56fbb2e --- /dev/null +++ b/marimo-notebook/break_even_analysis_chart_code.py @@ -0,0 +1,72 @@ +# flake8: noqa + +import marimo + +__generated_with = "0.11.0" +app = marimo.App(width="medium") + + +@app.cell +def _(): + import matplotlib.pyplot as plt + import marimo as mo + + return mo, plt + + +@app.cell +def _(): + fixed_cost = 50000 + unit_cost = 2 + selling_price = 10 + upper_production_quantity = 10000 + return fixed_cost, selling_price, unit_cost, upper_production_quantity + + +@app.cell +def _( + fixed_cost, + plt, + selling_price, + unit_cost, + upper_production_quantity, +): + break_even_quantity = fixed_cost / (selling_price - unit_cost) + break_even_income = fixed_cost + break_even_quantity * unit_cost + + units = range(0, upper_production_quantity + 1, 1000) + unit_costs = [(x * unit_cost) + fixed_cost for x in units] + sales_income = [unit * selling_price for unit in units] + + plt.plot(units, unit_costs, marker="o") + plt.plot(units, sales_income, marker="x") + + plt.xlabel("Units Produced") + plt.ylabel("($)") + plt.legend(["Total Costs", "Total Income"]) + plt.title("Break-Even Analysis") + + plt.vlines( + break_even_quantity, + ymin=0, + ymax=break_even_income, + linestyles="dashed", + ) + plt.text( + x=break_even_quantity + 100, + y=int(break_even_income / 2), + s=int(break_even_quantity), + ) + plt.grid() + plt.show() + return ( + break_even_income, + break_even_quantity, + sales_income, + unit_costs, + units, + ) + + +if __name__ == "__main__": + app.run() diff --git a/marimo-notebook/break_even_analysis_solution.py b/marimo-notebook/break_even_analysis_solution.py new file mode 100644 index 0000000000..be2cae0b59 --- /dev/null +++ b/marimo-notebook/break_even_analysis_solution.py @@ -0,0 +1,120 @@ +# flake8: noqa + +import marimo + +__generated_with = "0.11.0" +app = marimo.App(width="medium") + + +@app.cell +def _(): + import matplotlib.pyplot as plt + import marimo as mo + + return mo, plt + + +@app.cell +def _(ui_fixed_cost, ui_quantity, ui_selling_price, ui_unit_cost): + fixed_cost = int(ui_fixed_cost.value) + unit_cost = ui_unit_cost.value + selling_price = float(ui_selling_price.value) + upper_production_quantity = ui_quantity.value + return fixed_cost, selling_price, unit_cost, upper_production_quantity + + +@app.cell +def _( + fixed_cost, + plt, + selling_price, + ui_break_even, + ui_plot_color, + unit_cost, + upper_production_quantity, +): + break_even_quantity = fixed_cost / (selling_price - unit_cost) + break_even_income = break_even_quantity * selling_price + + units = range(0, upper_production_quantity + 1, 1000) + total_costs = [(unit * unit_cost) + fixed_cost for unit in units] + sales_income = [unit * selling_price for unit in units] + + plt.plot(units, total_costs, marker="o", color=ui_plot_color.value) + plt.plot(units, sales_income, marker="x") + + plt.xlabel("Units Produced") + plt.ylabel("($)") + plt.legend(["Total Costs", "Total Income"]) + plt.title("Break-Even Analysis") + + if ui_break_even.value: + plt.vlines( + break_even_quantity, + ymin=100, + ymax=break_even_income, + linestyles="dashed", + ) + + plt.text( + x=break_even_quantity + 100, + y=int(break_even_income / 2), + s=int(break_even_quantity), + ) + + plt.grid() + plt.show() + return ( + break_even_income, + break_even_quantity, + sales_income, + total_costs, + units, + ) + + +@app.cell +def _(mo): + ui_fixed_cost = mo.ui.radio(options=["40000", "50000"], value="50000") + + ui_unit_cost = mo.ui.slider(start=2, stop=5, step=1) + + ui_selling_price = mo.ui.text(value="10") + + ui_quantity = mo.ui.dropdown( + options={"10000": 10000, "12000": 12000, "15000": 15000}, value="10000" + ) + + ui_break_even = mo.ui.switch() + + ui_plot_color = mo.ui.dropdown( + options={"Red": "red", "Green": "green", "Blue": "blue"}, value="Red" + ) + + mo.md( + f""" + Fixed Costs: {ui_fixed_cost} + + Unit Cost Price: {ui_unit_cost} + + Selling Price: {ui_selling_price} + + Maximum Quantity: {ui_quantity} + + Display Break-Even Data: {ui_break_even} + + Total Costs Plot Color: {ui_plot_color} + """ + ) + return ( + ui_break_even, + ui_fixed_cost, + ui_plot_color, + ui_quantity, + ui_selling_price, + ui_unit_cost, + ) + + +if __name__ == "__main__": + app.run() diff --git a/marimo-notebook/equation.py b/marimo-notebook/equation.py new file mode 100644 index 0000000000..5b1245a44d --- /dev/null +++ b/marimo-notebook/equation.py @@ -0,0 +1,40 @@ +# flake8: noqa + +__generated_with = "0.11.0" + +# %% +import marimo as mo + +# %% +mo.md( + r""" + A quadratic equation is one of the form **$ax^2 + bx + c = 0$**, where a, b and c are constants, and a $\neq$ 0. + + You can solve it using the *quadratic formula*: + + $$x = \frac {-b \pm \sqrt{b^2 -4ac}} {2a}$$ + + For example, suppose you wanted to solve: **$2x^2 - 3x - 2 = 0$** + """ +) + +# %% +a = 2 + +# %% +import math + +# %% +b = -3 + +# %% +c = -2 + +# %% +x1 = (-b + math.sqrt(b**2 - 4 * a * c)) / (2 * a) + +# %% +x2 = (-b - math.sqrt(b**2 - 4 * a * c)) / (2 * a) + +# %% +print(f"x = {x1} and {x2}.") diff --git a/marimo-notebook/hidden_state.ipynb b/marimo-notebook/hidden_state.ipynb new file mode 100644 index 0000000000..83c2a3d406 --- /dev/null +++ b/marimo-notebook/hidden_state.ipynb @@ -0,0 +1,165 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "id": "e7b6110b-a96d-42aa-b123-bd98bada976c", + "metadata": {}, + "outputs": [], + "source": [ + "import math" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "b575de36-965d-4cda-809f-cd48110628ee", + "metadata": {}, + "outputs": [], + "source": [ + "def calculate_hypotenuse(opposite, adjacent):\n", + " return math.sqrt(opposite**2 + adjacent**2)" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "50fba4ad-0de5-4543-a477-22556129466b", + "metadata": {}, + "outputs": [], + "source": [ + "opposite = 3" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "8cc057a2-c2c9-4dca-a431-987b6f199838", + "metadata": {}, + "outputs": [], + "source": [ + "adjacent = 4" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "c36c350d-bcc8-45f6-afcc-0769132177ad", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "5.0" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "calculate_hypotenuse(opposite, adjacent)" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "42e63984-0fac-4e86-af9b-4c6b56bba087", + "metadata": {}, + "outputs": [], + "source": [ + "opposite = 5" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "6f2ead21-877e-4ed8-8955-c1aed1757126", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "6.4031242374328485" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "calculate_hypotenuse(opposite, adjacent)" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "6eceb0f4-b9e2-4213-8d7e-6087bd7507d4", + "metadata": {}, + "outputs": [], + "source": [ + "adjacent = 12" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "id": "35546944-6b52-4907-b1e6-3030d589442d", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "13.0" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "calculate_hypotenuse(opposite, adjacent)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0319e99d-82a1-4c13-9a71-4a9d868dcfe2", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "75cbba4e-deeb-42dc-b3da-c69f4e71eb1a", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.13.1" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/marimo-notebook/hypotenuse_calculator.py b/marimo-notebook/hypotenuse_calculator.py new file mode 100644 index 0000000000..6c4c0f77f7 --- /dev/null +++ b/marimo-notebook/hypotenuse_calculator.py @@ -0,0 +1,41 @@ +import marimo + +__generated_with = "0.11.0" +app = marimo.App(width="medium") + + +@app.cell +def _(math): + def calculate_hypotenuse(opposite, adjacent): + return math.sqrt(opposite**2 + adjacent**2) + + return (calculate_hypotenuse,) + + +@app.cell +def _(): + opposite = 3 + return (opposite,) + + +@app.cell +def _(): + adjacent = 4 + return (adjacent,) + + +@app.cell +def _(adjacent, calculate_hypotenuse, opposite): + calculate_hypotenuse(opposite, adjacent) + return + + +@app.cell +def _(): + import math + + return (math,) + + +if __name__ == "__main__": + app.run() diff --git a/marimo-notebook/hypotenuse_calculator_after_deletion.py b/marimo-notebook/hypotenuse_calculator_after_deletion.py new file mode 100644 index 0000000000..adea4e5e6b --- /dev/null +++ b/marimo-notebook/hypotenuse_calculator_after_deletion.py @@ -0,0 +1,35 @@ +import marimo + +__generated_with = "0.11.0" +app = marimo.App(width="medium") + + +@app.cell +def _(math): + def calculate_hypotenuse(opposite, adjacent): + return math.sqrt(opposite**2 + adjacent**2) + + return (calculate_hypotenuse,) + + +@app.cell +def _(): + adjacent = 10 + return (adjacent,) + + +@app.cell +def _(adjacent, calculate_hypotenuse, opposite): + calculate_hypotenuse(opposite, adjacent) + return + + +@app.cell +def _(): + import math + + return (math,) + + +if __name__ == "__main__": + app.run() diff --git a/marimo-notebook/hypotenuse_calculator_after_update.py b/marimo-notebook/hypotenuse_calculator_after_update.py new file mode 100644 index 0000000000..8320d9d9bd --- /dev/null +++ b/marimo-notebook/hypotenuse_calculator_after_update.py @@ -0,0 +1,41 @@ +import marimo + +__generated_with = "0.11.0" +app = marimo.App(width="medium") + + +@app.cell +def _(math): + def calculate_hypotenuse(opposite, adjacent): + return math.sqrt(opposite**2 + adjacent**2) + + return (calculate_hypotenuse,) + + +@app.cell +def _(): + opposite = 3 + return (opposite,) + + +@app.cell +def _(): + adjacent = 10 + return (adjacent,) + + +@app.cell +def _(adjacent, calculate_hypotenuse, opposite): + calculate_hypotenuse(opposite, adjacent) + return + + +@app.cell +def _(): + import math + + return (math,) + + +if __name__ == "__main__": + app.run() diff --git a/marimo-notebook/hypotenuse_calculator_before_update.py b/marimo-notebook/hypotenuse_calculator_before_update.py new file mode 100644 index 0000000000..6c4c0f77f7 --- /dev/null +++ b/marimo-notebook/hypotenuse_calculator_before_update.py @@ -0,0 +1,41 @@ +import marimo + +__generated_with = "0.11.0" +app = marimo.App(width="medium") + + +@app.cell +def _(math): + def calculate_hypotenuse(opposite, adjacent): + return math.sqrt(opposite**2 + adjacent**2) + + return (calculate_hypotenuse,) + + +@app.cell +def _(): + opposite = 3 + return (opposite,) + + +@app.cell +def _(): + adjacent = 4 + return (adjacent,) + + +@app.cell +def _(adjacent, calculate_hypotenuse, opposite): + calculate_hypotenuse(opposite, adjacent) + return + + +@app.cell +def _(): + import math + + return (math,) + + +if __name__ == "__main__": + app.run() diff --git a/marimo-notebook/hypotenuse_calculator_duplicate_variable.py b/marimo-notebook/hypotenuse_calculator_duplicate_variable.py new file mode 100644 index 0000000000..736177dbe3 --- /dev/null +++ b/marimo-notebook/hypotenuse_calculator_duplicate_variable.py @@ -0,0 +1,47 @@ +import marimo + +__generated_with = "0.11.0" +app = marimo.App(width="medium") + + +@app.cell +def _(math): + def calculate_hypotenuse(opposite, adjacent): + return math.sqrt(opposite**2 + adjacent**2) + + return (calculate_hypotenuse,) + + +@app.cell +def _(): + opposite = 3 + return (opposite,) + + +@app.cell +def _(): + adjacent = 4 + return (adjacent,) + + +@app.cell +def _(adjacent, calculate_hypotenuse, opposite): + calculate_hypotenuse(opposite, adjacent) + return + + +@app.cell +def _(): + import math + + return (math,) + + +@app.cell +def _(): + adjacent = 10 + return (adjacent,) + + +if __name__ == "__main__": + app.run() diff --git a/marimo-notebook/packages.py b/marimo-notebook/packages.py new file mode 100644 index 0000000000..0fef64ef59 --- /dev/null +++ b/marimo-notebook/packages.py @@ -0,0 +1,27 @@ +# /// script +# requires-python = ">=3.13" +# dependencies = [ +# "marimo", +# "pandas==2.2.3", +# ] +# /// +import marimo + +__generated_with = "0.11.0" +app = marimo.App(width="medium") + + +@app.cell +def _(): + import pandas as pd + + data = {"rank": [1, 2, 3], "language": ["Python", "Java", "JavaScript"]} + languages = pd.DataFrame(data) + + languages + + return data, languages, pd + + +if __name__ == "__main__": + app.run() diff --git a/marimo-notebook/quadratic.py b/marimo-notebook/quadratic.py new file mode 100644 index 0000000000..e97fef0920 --- /dev/null +++ b/marimo-notebook/quadratic.py @@ -0,0 +1,74 @@ +import marimo + +__generated_with = "0.11.0" +app = marimo.App(width="medium") + + +@app.cell +def _(): + import marimo as mo + + return (mo,) + + +@app.cell +def _(mo): + mo.md( + r""" + A quadratic equation is one of the form **$ax^2 + bx + c = 0$**, where a, b and c are constants, and a $\neq$ 0. + + You can solve it using the *quadratic formula*: + + $$x = \frac {-b \pm \sqrt{b^2 -4ac}} {2a}$$ + + For example, suppose you wanted to solve: **$2x^2 - 3x - 2 = 0$** + """ + ) + return + + +@app.cell +def _(a, b, c, math): + x1 = (-b + math.sqrt(b**2 - 4 * a * c)) / (2 * a) + return (x1,) + + +@app.cell +def _(a, b, c, math): + x2 = (-b - math.sqrt(b**2 - 4 * a * c)) / (2 * a) + return (x2,) + + +@app.cell +def _(): + a = 2 + return (a,) + + +@app.cell +def _(): + import math + + return (math,) + + +@app.cell +def _(): + b = -3 + return (b,) + + +@app.cell +def _(): + c = -2 + return (c,) + + +@app.cell +def _(x1, x2): + print(f"x = {x1} and {x2}.") + return + + +if __name__ == "__main__": + app.run() diff --git a/marimo-notebook/simultaneous_equations.py b/marimo-notebook/simultaneous_equations.py new file mode 100644 index 0000000000..f56a6f567a --- /dev/null +++ b/marimo-notebook/simultaneous_equations.py @@ -0,0 +1,56 @@ +import marimo + +__generated_with = "0.11.0" +app = marimo.App(width="medium") + + +@app.cell +def _(): + import marimo as mo + + return (mo,) + + +@app.cell +def _(mo): + mo.md( + r""" + **Problem:** + + Solve the following simultaneous equations using Python: + + $4x + 2y = 34$ + + $2x - y = 31$ + """ + ) + return + + +@app.cell +def _(): + import numpy as np + + coefficients = np.array([[4, 2], [2, -1]]) + results = np.array([34, 31]) + solution = np.linalg.solve(coefficients, results) + solution + return coefficients, np, results, solution + + +@app.cell +def _(mo, solution): + mo.md( + f""" + The solution to these simultaneous equations is: + + **x = {solution[0]}** + + **y = {solution[1]}** + """ + ) + return + + +if __name__ == "__main__": + app.run() diff --git a/marimo-notebook/simultaneous_equations_ui.py b/marimo-notebook/simultaneous_equations_ui.py new file mode 100644 index 0000000000..56e36eaead --- /dev/null +++ b/marimo-notebook/simultaneous_equations_ui.py @@ -0,0 +1,95 @@ +import marimo + +__generated_with = "0.11.0" +app = marimo.App(width="medium") + + +@app.cell +def _(): + import marimo as mo + + return (mo,) + + +@app.cell +def _(mo): + equation_1_x = mo.ui.text(value="-3.5") + equation_1_y = mo.ui.text(value="7") + equation_2_x = mo.ui.text(value="7") + equation_2_y = mo.ui.text(value="-10") + equation_1_result = mo.ui.text(value="0") + equation_2_result = mo.ui.text(value="4") + + mo.md( + f""" + Enter your equation's coefficients below: + + {equation_1_x}$x$ + {equation_1_y}$y$ = {equation_1_result} + + {equation_2_x}$x$ + {equation_2_y}$y$ = {equation_2_result} + """ + ) + return ( + equation_1_result, + equation_1_x, + equation_1_y, + equation_2_result, + equation_2_x, + equation_2_y, + ) + + +@app.cell +def _( + equation_1_result, + equation_1_x, + equation_1_y, + equation_2_result, + equation_2_x, + equation_2_y, +): + import numpy as np + + coefficients = np.array( + [ + [float(equation_1_x.value), float(equation_1_y.value)], + [float(equation_2_x.value), float(equation_2_y.value)], + ] + ) + results = np.array( + [float(equation_1_result.value), float(equation_2_result.value)] + ) + solution = np.linalg.solve(coefficients, results) + return coefficients, np, results, solution + + +@app.cell +def _( + equation_1_result, + equation_1_x, + equation_1_y, + equation_2_result, + equation_2_x, + equation_2_y, + mo, + solution, +): + mo.md( + f""" + The solution to the simultaneous equations: + + **{float(equation_1_x.value):.2f}$x${float(equation_1_y.value):+.2f}$y$ = {equation_1_result.value}** + + **{float(equation_2_x.value):.2f}$x${float(equation_2_y.value):.2f}$y$ = {equation_2_result.value}** + + is + + **$x$ = {solution[0]}** + **$y$ = {solution[1]}** + """ + ) + return + + +if __name__ == "__main__": + app.run()