Boolean Logic question

Been going through ex28 on the python book and was doing the study drills where I was practicing my own boolean statements.

I stumbled across something I don’t really understand:

True and False

False and True

False and True == False

How come False and True doesn’t equal False?
Does it have something to do with the thing that not everything that is not True equals False and such? I just need some explaining plz

Thanks for the read!

Hello @Rachel

For the two first examples it might be easy if you see it as a cord from a battery (+) on this cord there is two swithes after each other followed by a lamp and end up at the battery again (-).
To close this circuit (turn on the lamp) both switches has to be ON.
This is True And True in “Boolean”.
If you turn one switch OFF you have False And True, and the lamp is turned off.

For your last example it will be easier to understand if you put brackets around the statements.

False and True == False

is the same as:

False and (True == False)

wich is the same as

False and False

So this lamp is also turned off. :slight_smile:

1 Like

Thanks I think I got mixed up on what the shell outputs (not if my statement is correct or not but the solution of my problem). This pretty much cleared it up for me so thank you!! :slight_smile: