I am not looking for the answer for this code, but I would like to know how to do the working out in the -(-(-(-2))) ...
part.
I tried looking it up on Google "Python negative braces.."
etc etc but nothing.
-(-(-(-2))) == -2 and 4 >= 16 ** 0.5
That works exactly the same way it would in ordinary mathematical notation. -(anything)
is the negation of whatever is in the parentheses. The negation of 2 is -2, and the negation of -2 is 2.
-(-2) is the negation of -2, which is 2.
-(-(-2)) is the negation of -(-2). -(-2) is 2, and the negation of that is -2.
-(-(-(-2))) is the negation of -(-(-2)). -(-(-2)) is -2, and the negation of that is 2.
What this means is essentially
negative negative negative negative 2
. So because a negative of a negative a positive, this is equal to positive 2.So in the end:
-(-(-(-2))) == -2
isFalse
, so if you include that as part of anand
, you will getFalse
no matter what: