Vihang28 commited on
Commit
6906103
·
1 Parent(s): 2a8ca9e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -2
app.py CHANGED
@@ -47,7 +47,13 @@ def str_count(str3,sub_str):
47
  new_sub_str = sub_str.lower()
48
  x = new_str3.count(new_sub_str)
49
  return x
50
-
 
 
 
 
 
 
51
 
52
  st.markdown("<h3 style='text-align:center; font-size:24px;'>Mathematical and String Operations</h3>", unsafe_allow_html=True)
53
  st.write("---")
@@ -93,4 +99,12 @@ if radio_bar == description5 :
93
  all_data = st.button("Show result")
94
  if all_data:
95
  result = str_count(str3,sub_str)
96
- st.success(f"The sub-string is present {result} times in the string")
 
 
 
 
 
 
 
 
 
47
  new_sub_str = sub_str.lower()
48
  x = new_str3.count(new_sub_str)
49
  return x
50
+
51
+ def check_palin(check_num):
52
+ num_str = str(check_num)
53
+ if num_str == num_str[::-1] :
54
+ return("Palindrom")
55
+ else:
56
+ return("Not Palindrom")
57
 
58
  st.markdown("<h3 style='text-align:center; font-size:24px;'>Mathematical and String Operations</h3>", unsafe_allow_html=True)
59
  st.write("---")
 
99
  all_data = st.button("Show result")
100
  if all_data:
101
  result = str_count(str3,sub_str)
102
+ st.success(f"The sub-string is present {result} times in the string.")
103
+
104
+ if radio_bar == description6 :
105
+ st.markdown("<h6 style='text-align:center; font-size:16px;'>"+description6+"</h6>", unsafe_allow_html=True)
106
+ check_num = st.number_input(label="Enter First Number:",value=0)
107
+ all_data = st.button("Check")
108
+ if all_data:
109
+ result = check_palin(check_num)
110
+ st.success(result)