How to ensure that Multiselect can never be empty?

st.sidebar.header(“Please Filter Here:”)
city = st.sidebar.multiselect(
“Select the City:”,

I have the above multiselect but it allows user to cross out all selections, so the multiselect has none selected , which then gives error. So I want a way to restrict the user not to be able to completely clear out the multiselect - atleast one value must be selected at all times.

How about give city a default value if city return None?

1 Like