Python Forum
These boolean statements don't make sense?
Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
These boolean statements don't make sense?
#1
In trying to diagnose a problem with my code, I have traced the problem to the following result, which makes no sense to me. I was wondering if somebody could make sense of the problem:


'2'.isupper() == False & '2'.islower() == False & '2'.isdigit() == False:
Output:
True
Shouldn't this evaluate to False, since the third and final condition ('2'.isdigit() == False) is False?
When I evaluate the third and final condition by itself without the first two, it evaluates to False:

'2'.isdigit() == False
Output:
False
Reply


Messages In This Thread
These boolean statements don't make sense? - by Athenaeum - Oct-02-2017, 09:05 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Can anyone make sense of this? steve_shambles 7 3,390 Apr-19-2020, 11:22 AM
Last Post: steve_shambles
  Re writing poste to make sense please help me Nearrivers 10 5,930 Apr-02-2018, 11:52 PM
Last Post: Nearrivers

Forum Jump:

User Panel Messages

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