How exactly does not work, especially if we write not not?
The basics are simple enough, but like a lot of things we’ve learned so far, can become pretty tricky if we add onto them! The
not operator is no exception!
Something that may help us when determining if a statement is True or False is breaking it down into its simplest parts and then solving the whole thing. Take a look below for an example:
bool_complicado = not not 3 ** 2 + 10 != 60
First let’s do the stuff after the 2
nots to make life easier. Step by step, that’d look like:
bool_complicado = not not 9 + 10 != 60 bool_complicado = not not 19 != 60 bool_complicado = not not True
Great! Now we see it in a much simpler form and can apply those pesky
nots. Always apply the inner-most
bool_complicado = not False bool_complicado = True
not True became
False on the first line above, and then
not False is as much as we could break it down before writing the final answer!