Spaces:
Sleeping
Sleeping
File size: 707 Bytes
5339617 4ddfe35 5339617 4ddfe35 5339617 4ddfe35 5339617 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
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}")
|