How to apply st.slider to function

thanks sir, i understand by the way, would you like to solve my other problem ?