Boolean operators

I am having difficulties understanding booleans.

Specifically this

I’m not even quite sure how to word my question other then this is not clicking, im not sure how they got true from : True or not False and False

can anyone help me?

It is described above, but a quick review of operator precedence will fill in the holes.

Notice that not has higher precedence than and, and and has higher precedence than or. That is why we start with not, then and and finally or.

True or not False and False
True or True and False
True or False  =>  True

hmmm okay yes this is making a little more sense.

so as I have learned not False = true

so True and False = False? because and checks if both statements are true? and its obviously not because we have true and false, not just true and true?

and how did you get true or false => true ? because its not false or false?

sorry if i am rambling for some reason this is confusing me! Thank you Sir!

Correct; and, not True == False


In an or expression, only one operand needs to be True for the whole thing to be true. Read up on short-circuiting.

1 Like

Thank you so much!!!

1 Like