Spaces:
Runtime error
Runtime error
Download app.py from DataWizard9742/calci: direct link, hf CLI and curl.
- Browser
- Download file 648 Bytes
-
https://huggingface.co/spaces/DataWizard9742/calci/resolve/main/app.py
- Command line
-
hf download hf://spaces/DataWizard9742/calci/app.py
-
curl -L -o app.py https://huggingface.co/spaces/DataWizard9742/calci/resolve/main/app.py
648 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 CALCULATOR BY FSA") | |
| num1 = st.number_input("enter first number: ") | |
| num2 = st.number_input("enter second number: ") | |
| choice = st.radio("Select your choice",("ADD","SUBTRACT","MULTIPLY","DIVIDE")) | |
| if choice=="ADD": | |
| result = add(num1,num2) | |
| elif choice=="SUBTRACT": | |
| result = sub(num1,num2) | |
| elif choice=="MULTIPLY": | |
| result = multiply(num1,num2) | |
| elif choice=="DIVIDE": | |
| result = divide(num1,num2) | |
| st.write("Result is: ",result) |