Update app.py
Browse files
app.py
CHANGED
|
@@ -55,20 +55,16 @@ def check_palin(check_num):
|
|
| 55 |
else:
|
| 56 |
return("Not Palindrom")
|
| 57 |
|
| 58 |
-
def create_new(
|
| 59 |
-
first_lst = []
|
| 60 |
-
sec_lst = []
|
| 61 |
fin_lst = []
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
for
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
if y % 2 == 0:
|
| 71 |
-
fin_lst.append(y)
|
| 72 |
return(fin_lst)
|
| 73 |
|
| 74 |
st.markdown("<h3 style='text-align:center; font-size:24px;'>Mathematical and String Operations</h3>", unsafe_allow_html=True)
|
|
@@ -127,9 +123,9 @@ if radio_bar == description6 :
|
|
| 127 |
|
| 128 |
if radio_bar == description7 :
|
| 129 |
st.markdown("<h6 style='text-align:center; font-size:16px;'>"+description7+"</h6>", unsafe_allow_html=True)
|
| 130 |
-
|
| 131 |
-
|
| 132 |
all_data = st.button("Check")
|
| 133 |
if all_data:
|
| 134 |
-
result = create_new(
|
| 135 |
st.success(result)
|
|
|
|
| 55 |
else:
|
| 56 |
return("Not Palindrom")
|
| 57 |
|
| 58 |
+
def create_new(num_str1,num_str2):
|
|
|
|
|
|
|
| 59 |
fin_lst = []
|
| 60 |
+
num_lst1 = num_str1.split()
|
| 61 |
+
num_lst2 = num_str2.split()
|
| 62 |
+
for x in num_lst1:
|
| 63 |
+
if int(x) % 2 == 1:
|
| 64 |
+
fin_lst.append(int(x))
|
| 65 |
+
for y in num_lst2:
|
| 66 |
+
if int(y) % 2 == 0:
|
| 67 |
+
fin_lst.append(int(y))
|
|
|
|
|
|
|
| 68 |
return(fin_lst)
|
| 69 |
|
| 70 |
st.markdown("<h3 style='text-align:center; font-size:24px;'>Mathematical and String Operations</h3>", unsafe_allow_html=True)
|
|
|
|
| 123 |
|
| 124 |
if radio_bar == description7 :
|
| 125 |
st.markdown("<h6 style='text-align:center; font-size:16px;'>"+description7+"</h6>", unsafe_allow_html=True)
|
| 126 |
+
num_str1 = st.text_input(label="Enter the numbers of first list and seperate each number by single space(' '):",value=0)
|
| 127 |
+
num_str2 = st.text_input(label="Enter the numbers of second list and seperate each number by single space(' '):",value=0)
|
| 128 |
all_data = st.button("Check")
|
| 129 |
if all_data:
|
| 130 |
+
result = create_new(num_str1,num_str2)
|
| 131 |
st.success(result)
|