Python Forum
I'm a bit confused with these boolean operations on integers
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I'm a bit confused with these boolean operations on integers
#2
Output:
3 < (10 or 2) must be stated as 3 < 10 or 3 < 2 = True (same as True or False which is True) ______ or _____ True False = True 3 < (2 or 10) must be stated as 3 < 2 or 3 < 10 = True _____ or ______ True True = True
written as you have it:
3 < (10 or 2) if expanded
(3 < 10) or 2 = True

3 < (2 or 10)
(3 < 2) or 10 = False

boolean:
3 < (10 | 2) = True
3 < (2 | 10) = True
Reply


Messages In This Thread
RE: I'm a bit confused with these boolean operations on integers - by Larz60+ - Aug-25-2018, 08:07 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Need help implementing an input with file operations Gaijin 3 2,161 Jun-08-2022, 05:50 PM
Last Post: Gaijin
  i'm confused with this if-else assignment gabejohnsonny21 4 1,916 Mar-14-2020, 03:56 PM
Last Post: gabejohnsonny21
  Order of operations for reassignment of a variable StillAnotherDave 1 1,746 Jan-21-2020, 12:20 PM
Last Post: buran
  Arithmetic operations using lists yassine 2 2,473 May-02-2018, 06:20 PM
Last Post: j.crater
  Just a bit confused TimeForged 2 2,635 Feb-09-2018, 11:27 PM
Last Post: TimeForged

Forum Jump:

User Panel Messages

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