Let a, b, c, d be integers such that a≤ b and c≤ d. Write a function do_they_intersect(a, b, c, d) that tells us whether the open intervals (a, b) and (c, d) have a nonempty intersection.
Observation
Only the function will be evaluated. If your submission includes a main program (e.g. with testmod), it must be either commented out or inside a condition if __name__ == ’__main__’
>>> do_they_intersect(1, 5, 3, 7) True >>> do_they_intersect(10, 15, 1, 5) False >>> do_they_intersect(3, 5, 2, 11) True >>> do_they_intersect(1, 4, 4, 5) False >>> do_they_intersect(10, 10, 9, 11) False >>> not do_they_intersect(2, 3, 1, 2) True