Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

interact variable not found

I keep getting ValueError: Variable 'h' not found when I try to plot an interact:

    f = (x-h)^2 - 4*a*(y-k)
    Parabola = solve(f,y)[0].rhs()
    print(Parabola)
    @interact
    def _(h=slider(-5,5,default=1), a=slider(-5,5,default=1), k=slider(-5,5,default=1)):
            show(plot(Parabola,x,-5,5))

It even creates the sliders but the plot can't see h. What am I doing wrong? print(Parabola)image description