The comparison of the variable with several values through OR works incorrectly
📁 Advanced Python Topics, example
"
I had a problem with the if operator and its function or . When working with the str, it looks something like this
if a == "zero" " or " "zero" ": print ( 0 ) elif a == "" "one" or : print ( 1 ) # prints only 0 for any values of a What should I do and how to fix it?
"
No answers yet.
Log in to leave an answer