Apr-16-2020, 09:54 PM
When you write
You could instead do something verbose like:
if zoom=="Yes" or "yes" or "Y" or "y":Python parses the expression as (zoom=="Yes") or ("yes")... It's not comparing the bits after the or to the value in zoom, it's checking if they're true. Since "yes" evaluates to true (as does any non-empty string), then this conditional is always true.
You could instead do something verbose like:
if zoom == "Yes" or zoom == "yes" or zoom == "Y" .....But you'd probably prefer:
if zoom in ["Yes", "yes", "Y", "y"]: