Spaces:
Sleeping
Sleeping
File size: 845 Bytes
a8bc778 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
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__":
|