In [1]:
import random, numpy
y=0
while (y<1 or y>100):
c5=random.choice([1,2,3,5,6,7,8,9])
c4=random.choice([-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,5,6,7,8,9])
c3=random.choice([-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,5,6,7,8,9])
c2=random.choice([-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,5,6,7,8,9])
c1=random.choice([-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,5,6,7,8,9])
c0=random.choice([-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,5,6,7,8,9])
x=random.choice([3,4,4,5,5,5,6,6,6,7,7,7,8,8,9])
y=c5*x**5+c4*x**4+c3*x**3+c2*x**2+c1*x+c0
p1 = numpy.poly1d([c5,c4,c3,c2,c1,c0])
print(p1)
print("X =",x)
print ("Y =", y)