Python Forum
Help needed to troubleshoot.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help needed to troubleshoot.
#3
When you write

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"]:
Reply


Messages In This Thread
Help needed to troubleshoot. - by mefev12229 - Apr-16-2020, 09:26 PM
RE: Help needed to troubleshoot. - by micseydel - Apr-16-2020, 09:31 PM
RE: Help needed to troubleshoot. - by bowlofred - Apr-16-2020, 09:54 PM
RE: Help needed to troubleshoot. - by deanhystad - Apr-16-2020, 10:15 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  strategy to troubleshoot what pyinstaller misses hammer 0 999 May-23-2022, 01:05 AM
Last Post: hammer

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020