Spaces:
Build error
Build error
| import streamlit as st | |
| st.title("Simple Calculator") | |
| a, b, c, d = st.columns(4) | |
| def calculator(): | |
| num1 = st.number_input("Input First Number Here") | |
| num2 = st.number_input("Input Second Number Here") | |
| if a.button("Addition"): | |
| add = num1 + num2 | |
| st.write(f"The Result Is: {add}") | |
| if b.button("Multiplication"): | |
| mul = num1 * num2 | |
| st.write(f"The Result Is: {mul}") | |
| if c.button("Division"): | |
| if num2 != 0: | |
| div = num1 / num2 | |
| st.write(f"The Result Is: {div}") | |
| else: | |
| st.error("Division by Zero is not allowed.") | |
| if d.button("Minus"): | |
| sub = num1 - num2 | |
| st.write(f"The Result Is: {sub}") | |
| calculator() | |
| #( | |
| #debar.title("Calculator App") | |
| #e = st.sidebar.radio("Select Operation", ("Addition",)) | |
| # | |
| # page == "Addition": | |
| # add() | |
| #name__ == "__main__": | |