True and False showing up with user input issue

Hi ,

straight to the point , when I use st.selectbox in ( if ) condition to get input from the user , True and False conditions show up for some of the inputs .

here is the web app link :
https://share.streamlit.io/artisticov/ultimate-regression-web-app/main/main.py


Hi @ARTiSticov, welcome to the Streamlit community!! :tada: :partying_face: :tada:

It looks like you’re accidentally using the == comparison operator in place of the = assignment operator in lines 89, 93, 101, 120, 124, 126, and 128.

For example: if a user selects Wagon from the dropdown for carbody, the following block is executed next:

elif user_inp4 == "Wagon":
      user_input4 == 4

As you’ve previously set user_input4 = 3 in line 83, Python checks if 3 == 4 and returns False.

Let us know if this helps :grinning_face_with_smiling_eyes:

Happy Streamlit-ing! :balloon:
Snehan

1 Like