Don't give expected Output

Sir , i have written the same code . but it will not generating the plot . Even if i am trying to print errors it generate only single value . I don’t get it why . Can you please review my code and say what’s wrong .

Link :-

I have run this code in jupyter .

hey @shubhambarnwal02 ,
you are returning the values inside the for loop ,
just de indent that return statement , and it will work fine.