If syntax error while attempting to incorporate in a st.select_slider()

It’s not about the slider, it’s just Python syntax in general. (Maybe you are a heavy SQL user?)

In Python, you can’t substitute in a raw if-else clause where you want some conditional value. You can however define a function that runs the if-else clause and returns the result, then use that function where you want the result. For example

condition = st.radio('Condition', [1,2,3])

def get_min_max(condition):
    if condition == 1:
        return (0,1)
    elif condition == 2:
        return (10,20)
    else:
        return (200,300)

# Option 1
# * is used to unpack the tuple into two separate objects
st.slider('Choose:',*get_min_max(condition), value = get_min_max(condition)[0], key='opt1')
# Option 2
# min and max are pulled out of the tuple by index
st.slider('Choose:',get_min_max(condition)[0],get_min_max(condition)[1], value = get_min_max(condition)[0], key='opt2')
# Option 3
# Get min, max saved to variables and use those variables
min_value, max_value = get_min_max(condition)
st.slider('Choose:',min_value, max_value, value=min_value, key='opt3')

There is also a fiddly detail with changing the boundaries of a widget. Either use a key with a time stamp so Streamlit disassociates itself from previous page loads, or manually deal with the value argument because otherwise it could stay on a number that is no longer valid for the current available range. (If you remove the value argument from the three examples, you’ll see what I mean since I set each range of numbers to be exclusive of each other.)

There are lots of ways to tie options together. You may need to look into session state and callback functions depending on how much interaction you are hoping to get.

If you want to take the user through some stages of selection (“Choose this first, then this, then that.”), I have a snippet here that will conditionally display the next bit of instructions or options for users.