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