2022-10-11 19:27:51 +00:00
|
|
|
def intersects(a1, b1, a2, b2):
|
2023-05-16 20:18:38 +00:00
|
|
|
assert a1 <= b1 and a2 <= b2, "Os intervalos não são válidos."
|
2023-11-08 17:15:11 +00:00
|
|
|
return a1 < b2 and a2 < b1
|
2022-10-11 19:27:51 +00:00
|
|
|
|
|
|
|
|
2023-05-16 20:18:38 +00:00
|
|
|
def main():
|
|
|
|
a1 = float(input("a1: "))
|
|
|
|
b1 = float(input("b1: "))
|
|
|
|
a2 = float(input("a2: "))
|
|
|
|
b2 = float(input("b2: "))
|
2022-10-11 19:27:51 +00:00
|
|
|
|
2023-05-16 20:18:38 +00:00
|
|
|
try:
|
|
|
|
print(intersects(a1, b1, a2, b2))
|
|
|
|
except AssertionError as e:
|
|
|
|
print(e)
|
|
|
|
|
|
|
|
|
|
|
|
main()
|