Spaces:
Runtime error
Runtime error
Download app.py from Sk4467/Calculator-test-CICD: direct link, hf CLI and curl.
- Browser
- Download file 707 Bytes
-
https://huggingface.co/spaces/Sk4467/Calculator-test-CICD/resolve/main/app.py
- Command line
-
hf download hf://spaces/Sk4467/Calculator-test-CICD/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Sk4467/Calculator-test-CICD/resolve/main/app.py
707 Bytes
| 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}") | |