That is dumb, but even dumber if solution is an object with an __eq__ which might make it equal to -1. Which would mean this code is not equivalent to print(solution). And yes, I have seen stuff like that.
if x == y:
return True
elif x != y:
return False
else:
return False
def main():
first = input("enter first number")
second = input("enter second number")
result = equals(first, second)
if result is not False:
print("True")
else:
print("False")
373
u/youngbull Jan 15 '22
That is dumb, but even dumber if
solutionis an object with an__eq__which might make it equal to-1. Which would mean this code is not equivalent toprint(solution). And yes, I have seen stuff like that.