How do I get the opposite (negation) of a Boolean in Python?
How do I get the opposite (negation) of a Boolean in Python? For the following sample: def fuctionName(int, bool): if int in range(...): if bool == True: return False else: return True Is there any way to skip the second if-statement? Just to tell the computer to return the opposite of the boolean bool ? bool This is probably just pseudocode, but int and bool are both builtin names (for the types they represent), and should not be used as variable names. – SingleNegationElimination Aug 11 '11 at 18:19 int bool yes, it's just a pseudo-code ,, demonstration purposes only... – amyassin Aug 11 '11 at 18:26 ...