This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import streamlit as st | |
import inspect | |
import streamlit as st | |
import streamlit as st | |
import numpy as np | |
st.title("Streamlit Calculator") | |
st.markdown('**Calculator Demo:**') | |
number1 = st.number_input("Enter number one",1) | |
number2 = st.number_input("Enter number two",1) | |
operation = st.radio("Select : ", ('Add', 'Multiply')) | |
scenariosubmit = st.button('Run Demo') | |
result = 0 | |
if scenariosubmit: | |
if operation == 'Add': | |
result = number1 + number2 | |
if operation == 'Multiply': | |
result = number1 * number2 | |
st.markdown('**Results:**') | |
st.write(result) | |
Keep Adding more relevant examples!!!
No comments:
Post a Comment