Spaces:
Runtime error
Runtime error
Download app.py from Sumayyea/CalculatorApp: direct link, hf CLI and curl.
- Browser
- Download file 397 Bytes
-
https://huggingface.co/spaces/Sumayyea/CalculatorApp/resolve/main/app.py
- Command line
-
hf download hf://spaces/Sumayyea/CalculatorApp/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Sumayyea/CalculatorApp/resolve/main/app.py
397 Bytes
| import streamlit as st | |
| # Input fields | |
| num1 = st.number_input("Enter first number", value=0.0, format="%.2f") | |
| num2 = st.number_input("Enter second number", value=0.0, format="%.2f") | |
| def sum(a,b): # a=5.1, b=3.2 | |
| c = a + b # c=8.3 | |
| return c | |
| if st.button("Calculate Sum"): | |
| result = sum(num1,num2) # function call, result=8.3 | |
| st.success(f"The result is: {result}") |