Update app.py
Browse files
app.py
CHANGED
|
@@ -14,21 +14,21 @@ def sum_of_two(a,b):
|
|
| 14 |
prod = a*b
|
| 15 |
sum1 = a+b
|
| 16 |
if prod <= 1000 :
|
| 17 |
-
return(prod)
|
| 18 |
else:
|
| 19 |
-
return(sum1)
|
| 20 |
|
| 21 |
st.markdown("<h3 style='text-align:center; font-size:24px;'>Mathematical and String Operations</h3>", unsafe_allow_html=True)
|
| 22 |
st.write("---")
|
| 23 |
radio_bar = st.sidebar.radio(options=[description1, description2, description3, description4, description5, description6, description7, description8, description9], label="Select any one:")
|
| 24 |
if radio_bar == description1:
|
| 25 |
st.markdown("<h6 style='text-align:center; font-size:16px;'>"+description1+"</h6>", unsafe_allow_html=True)
|
| 26 |
-
first_num = st.number_input(label="Enter First Number",value=
|
| 27 |
-
second_num = st.number_input(label="Enter Second Number",value=
|
| 28 |
all_data = st.button("Calculate result")
|
| 29 |
if all_data:
|
| 30 |
if first_num == "" and second_num == "":
|
| 31 |
st.warning("Please Fill Above Fields")
|
| 32 |
else:
|
| 33 |
result = sum_of_two(first_num,second_num)
|
| 34 |
-
st.success(f"
|
|
|
|
| 14 |
prod = a*b
|
| 15 |
sum1 = a+b
|
| 16 |
if prod <= 1000 :
|
| 17 |
+
return("Product of the numbers: ",prod)
|
| 18 |
else:
|
| 19 |
+
return("Sum of the numbers: ",sum1)
|
| 20 |
|
| 21 |
st.markdown("<h3 style='text-align:center; font-size:24px;'>Mathematical and String Operations</h3>", unsafe_allow_html=True)
|
| 22 |
st.write("---")
|
| 23 |
radio_bar = st.sidebar.radio(options=[description1, description2, description3, description4, description5, description6, description7, description8, description9], label="Select any one:")
|
| 24 |
if radio_bar == description1:
|
| 25 |
st.markdown("<h6 style='text-align:center; font-size:16px;'>"+description1+"</h6>", unsafe_allow_html=True)
|
| 26 |
+
first_num = st.number_input(label="Enter First Number",value=0)
|
| 27 |
+
second_num = st.number_input(label="Enter Second Number",value=0)
|
| 28 |
all_data = st.button("Calculate result")
|
| 29 |
if all_data:
|
| 30 |
if first_num == "" and second_num == "":
|
| 31 |
st.warning("Please Fill Above Fields")
|
| 32 |
else:
|
| 33 |
result = sum_of_two(first_num,second_num)
|
| 34 |
+
st.success(f"{result}")
|