Exercises: and, or, not


#1

I just got done with the and, not, or section. I had very little trouble with the exercises. But the only thing I really didn't understand was the end of it where not get read first, and second, or last. Will someone please explain it to me and use examples.

Also when python says 4%2 I can't remember what % is.

Thank you in advance


#2

you seem to understand perfectly fine?

here is an example:

not False and True or 6 % 2 == 0

first we have to evaluate not so we get:

True and True or 6 % 2 ==0

then we have to evaluate and, True and True is True so then we have:

True or 6 % 2 == 0

then finally we evaluate or, the remainder of 6 divided by 2 is zero. So this is also True, so True or True is True.

the modulo operator % calculates the remainder


#3

thank you very much.


#4

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