calcy / app.py
Mohsinkhan77's picture
Create app.py
671e837 verified
raw
history blame contribute delete
654 Bytes
import streamlit as st
def add(x,y):
return x+y
def sub(x,y):
return x-y
def multiply(x,y):
return x*y
def divide(x,y):
if y == 0:
return "sorry not possible"
else:
return x/y
st.title ("simple calcy byb mks")
num1 = st.number_input("enter first number")
num2 = st.number_input("entr second number")
choice = st.radio("selectv your choice",("add","sub","multiply","divide"))
if choice == "add":
result = (add(num1,num2))
elif choice == "substract":
result = (sub(num1,num2))
elif choice == "multiply":
result = (multiply(num1,num2))
elif choice == "divide":
result = (divide(num1,num2))
st.write("result is", result)