Spaces:
Sleeping
Sleeping
import streamlit as st | |
from calculator import add, subtract, multiply, divide,greater | |
st.title("Calculator App") | |
operation = st.selectbox("Select operation:", ["Add", "Subtract", "Multiply", "Divide", "Greater than"]) | |
x = st.number_input("Enter first number:", value=0) | |
y = st.number_input("Enter second number:", value=0) | |
if st.button("Calculate"): | |
if operation == "Add": | |
result = add(x, y) | |
elif operation == "Subtract": | |
result = subtract(x, y) | |
elif operation == "Multiply": | |
result = multiply(x, y) | |
elif operation == "Divide": | |
result = divide(x, y) | |
elif operation=="Greater than": | |
result= greater(x,y) | |
st.write(f"The result is: {result}") | |