| 1 | initial version |
You can use list comprehension and the fact that symbolic expressions have a degree method as follows:
sage: L = [3*x+2, 4*x^3, x+x^2, SR(2)]
sage: [i for i in L if 1 <= i.degree(x) <= 2]
[3*x + 2, x^2 + x]
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.