def f(x): return x**2-5*x+6 S = {x for x in range(10) if f(x)==0 } print(S)