Error while visualization

while using the value of weight to find the value of x2,i t is showing that weight is not defined. I wrote the exact same code and didn’t find any mistake.
can you tell where there can be the problem in the code.

Hey, @Rajan,
Send me the code by saving it on IDE