create a functional streamlit app. the function can be anything
To upload files, please first save the app
import streamlit as st
import numpy as np
st.title("Simple Math App")
# Input numbers from user
num1 = st.number_input("Enter first number:")
num2 = st.number_input("Enter second number:")
# Perform calculations
if st.button("Calculate"):
sum_result = np.add(num1, num2)
sub_result = np.subtract(num1, num2)
mul_result = np.multiply(num1, num2)
div_result = np.divide(num1, num2) if num2 != 0 else "undefined"
# Display results
st.write("**Results:**")
st.write(f"Sum: {sum_result}")
st.write(f"Difference: {sub_result}")
st.write(f"Product: {mul_result}")
st.write(f"Quotient: {div_result}")
Hi! I can help you with any questions about Streamlit and Python. What would you like to know?