not (not false) = True?

14.3k Views Asked by At

I'm currently on page Conditionals & Control Flow, Python, Code Academy.

I've made this thinking it will be False but it is wrong.

Make me false!

bool_three = not (not False) == True

Objects in parentheses are worked out first, so by my logic:

not (not False [which becomes True]) = True

not True [which is false] = True
3

There are 3 best solutions below

0
On BEST ANSWER

not (not False [which becomes True]) = True

What makes you think "not not false" would be true? If a boolean value is negated, it becomes the opposite value. If it's negated again, it becomes the original value.

Let's derive it a step at a time...

  1. not (not False) == True
  2. not (True) == True
  3. False == True
  4. False
0
On

bool_three = not (not False) == True

Here that's goes :

not ( not False ) become not ( true ) became false.

Then False == True (which is false)

so then bool_three = false

1
On

Quick Python interpreter check:

>>> not not False == True
False