Given two input boolean values I want to print out the following results:
True True -> False
True False -> False
False True -> False
False False -> True
I tried doing this:
if boolInput1 and boolInput2 == True:
print(False)
elif boolInput1 == True and boolInput2 == False:
print(False)
elif boolInput1 == False and boolInput2 == True:
print(False)
elif boolInput1 and boolInput2 == False:
print(True)
but it doesn't work as this is the output:
Test Input Expected Actual
1 True True False False
2 True False False False
3 False True False False
4 False False True False
I've tried searching for an answer online but can't find anything.
print(not boolInput1 and not boolInput2)
True
for the first case andFalse
for all the others.