How to apply st.slider to function

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