The not operator flips a boolean value.
def andor3(val1, val2):
result = not (val1 and val2)
return result
Function Call | Return Value | |||
---|---|---|---|---|
andor3(True, True) | → | |||
andor3(True, False) | → | |||
andor3(False, True) | → | |||
andor3(False, False) | → |
Experiment with this code on Gitpod.io