79477102

Date: 2025-03-01 04:21:50
Score: 1
Natty:
Report link

I find a solution for the example in UPD using solveset and as_set:

from sympy import *
var('x', reals=True)
range = (x > 2) | (x < 0)
equation = Eq(x ** 2 - 1, 0)
print(solveset(equation, x, range.as_set()))
# Output: {-1}
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Qinshi Wang