Won't work


#1

bool_four = not not True or False and not True

`


#2

This bool is going to return false instead of true, and I'll show you why:

When taking the operators, Python first evaluates not, then and, and lastly or. The first part:

Will equal to True, as the first not makes it false and the "not false" makes it true once again. Then the "and" operator gets priority next, so we will have:

True and not True(which is technically already False)

This will become False, as anything that is not True and True with the and operator becomes false. Lastly,

False or False

will make the boolean's end result false, even though it is suppose to be true. This should fix things:

bool_four = not not True or False and True

-- @chipjumper36731


#3

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