cALCULATOR APP
To upload files, please first save the app
import streamlit as st
st.title("Simple Calculator")
# Get user input
num1 = st.number_input("Enter first number", value=0.0)
operation = st.selectbox("Select operation", ["+", "-", "*", "/"])
num2 = st.number_input("Enter second number", value=0.0)
# Calculate result
if st.button("Calculate"):
if operation == "+":
result = num1 + num2
elif operation == "-":
result = num1 - num2
elif operation == "*":
result = num1 * num2
elif operation == "/" and num2 != 0:
result = num1 / num2
else:
result = "Error: Division by zero!"
st.write(f"Result: {num1} {operation} {num2} = {result}")
Hi! I can help you with any questions about Streamlit and Python. What would you like to know?