How to combine two inequality answers into the same line

228 views Asked by At

So basically I'm being asked in class to solve an inequality -1<(7-x)/3<=4, and the teacher wants the answer of what will become two sets of code on the same line using solveset. So this ends up being solveset(-1<((7-x)/3),x,domain=S.Reals) and solveset (((7-x)/3)<=4,x,domain=S.Reals) But whenever I end up putting & or and in between them to get them on that same line output, I get either the answer to the first OR the answer to the second, which is the complete opposite of what I want. How should I be inputting this? I'm using Jupyter Python stuff. Specifically we've imported sympy stuff.

1

There are 1 answers

0
Madison Boutwell On

abc has answered! "solveset(-1<((7-x)/3), x, domain=S.Reals) & solveset (((7-x)/3)<=4, x, domain=S.Reals) will correctly give you the solution, i.e., Interval.Ropen(-5, 10) which means [-5, 10)"