FAQ: Learn Python - Conditionals & Control Flow - Not

faq

#1

This community-built FAQ covers the “Not” exercise in Codecademy’s lessons on Python.

FAQs for the Codecademy Python exercise Not:

Join the Discussion. We Want to Hear From You!

Have a new question or can answer someone else’s? Reply (reply) to an existing thread!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources about Python in general? Go here!

Want to take the conversation in a totally different direction? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account, billing, Pro, or Pro Intensive? Reach out to our support team!

None of the above? Find out where to ask other questions here!


#2

Please can you tell me why bool three is TRUE ??


#3

I am also confused by boolean 3:
If 10/3 <= 10/2 (which it is!) then that is True, so the not would make the answer “False”, I have clearly misunderstood some fundamental early on, I think!


#4

Boolean 3 evaluates the comparison of the remainders of two divisions, not the quotient. Thus, the remainder of 10/3 (which is 1) is > the remainder of 10/2 (which is 0). Hence, the expression evaluates to False, and not 1 <= 0 is True.


#5

Please explain me boolean 5
not not False


#6

Bool_four seems like it should resolve to “False” but the checker requires you to put “True” to complete the lesson.

Perhaps I am misunderstanding the question but:

not 3 ** 2 + 4 ** 2 != 5 ** 2
not 6 + 8 != 10
not 14 != 10
not True
False

Any insight why this would not be the case? Thanks!


#7

If you simplify the equation, not “not false”, “not false” becomes true. So now it reads “not true” which we know is now False. So boolean 5 = False. The nots essentially cancel each other out.