- Here is the code snippet in question:
st.write('The style for today will be ', style, '. If you would like to change this, enter it in the text box below.')
user_style = st.text_input('Style','Casual')
if(user_style != 'Casual' or user_style != 'Classy-casual' or user_style != 'Classy'):
print('The value you entered is not an option. Style will remain ' + style)
else:
st.write('Style changed to ', user_style)
style = user_style
By debugging I find that user_style does get the default value of ‘Casual’, but the if statement evaluates true.
- How would I go about making the program wait until the user actually inputs a value in the text_input field? I ask this because some choices are made based on style and I want the user to be able to make their choice before the program continues.