Label and values in in selectbox

Hey @godot63,

Looks like you could actually use format_func in this way to do what you want.

import streamlit as st

display = ("male", "female")

options = list(range(len(display)))

value = st.selectbox("gender", options, format_func=lambda x: display[x])

st.write(value)
8 Likes