Spaces:
Runtime error
Runtime error
File size: 654 Bytes
671e837 |
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 |
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) |