To get the opposite of a boolean in python, one can used the logical operator not:
>>> cond = True
>>> type(cond)
<class 'bool'>
>>> cond
True
>>> cond = not cond
>>> cond
False
References
Links | Site |
---|---|
not | programiz.com |
How do I get the opposite (negation) of a Boolean in Python? | stackoverflow |