Basically this question is pertraining to a Reddit Post. The function shouldn't be returning True mathematically. But -7 as mentioned in the comment's return's True surprisingly. Can anyone explain why -7 specifically? I'm using python 3.7.
def check(x):
if 1+x is x+1:
return False
if 2+x is not x+2:
return False
return True
check(-7)
True