I cant figure out why the logical operation

not not True or False and not True

is True.

Anyone can analyze this for me??

Thanks in advance

I cant figure out why the logical operation

not not True or False and not True

is True.

Anyone can analyze this for me??

Thanks in advance

Start with the NOT operations, first.

```
not True => False
not False => True
```

and

```
not True => False
```

so the expression boils down to,

```
True or False and False
```

I won’t go into how this is short-circuited, but follow the chain of precedence. AND is next to be evaluated…

```
False and False => False
```

Now the expression boils down to,

```
True or False => True
```

To explain *short-circuiting*, OR (as well as AND) expressions are evaluated from left to right. A `True`

found anywhere in an OR expression will abort the evaluation and yield `True`

as a result. That means any operands to the right of the found True will be ignored.

AND, by the same token will short-circuit on `False`

, as in going from left to right, the first `False`

encountered will abort the evaluation and yield `False`

as a result. Likewise, any remaining operands to the right will be ignored.

Thanks a lot!I was doing the exact same thing but i calculated or before and!

I was soo stuck

You’re welcome. And now you know to follow precedence rules at all times, since that what the computer is doing.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.