Ad
  • Default User Avatar

    Um... no.

    The construct if (a or b) < 0 will never be True, because (a or b) is parsed as a boolean clause ((a != 0) or (b != 0)) which can only return False (0) or True (1), which can never be < 0.

    You meant to write if (a < 0) or (b < 0):.