python 3.7
Hello.
I know that None
is the result of nothing being returned, however I can't understand why I am getting None
returned at the end of this code. I can't see anything left unfinished.
def test(a, b):
if a == True and b == True:
return False
elif a == True or b == True:
return True
elif a == False and b == False:
return False
else:
print("error... :(")
print(test(True, True))
print(test(True, False))
print(test(False, True))
print(test(False, False))
print(test(None, False))
When I run this code I get:
False
True
True
False
error... :(
None
I have also tried altering the else: statement to actually return the printed object hoping that my code was simply asking for a redundent return, but the output is the same.
else:
error = print("error... :(")
return error
Can anyone shed some light on where the None
is coming from?