Last answered:

17 Jul 2023

Posted on:

12 Jul 2023

0

I need help, why do i Have this error

I wrote out the same code but it is not running. That is the error message I am getting. 

5 answers ( 0 marked as helpful)
Instructor
Posted on:

13 Jul 2023

0

Hey Ferdinand,


Thank you for reaching out.


As the error message reads, the variables x_axis and values have different dimensions - one has 10 elements while the other has 11. They need to be the same in order for the plot() function to work properly.


Notice that the x_axis list is missing the value 0.1. Notice also that you have the value 0.7 twice. Make sure your list is defined as follows:

x_axis = [0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0]

and you should be able to run the code without any issues.


Kind regards,

365 Hristina

Posted on:

13 Jul 2023

0

Thank you for the response. The code still did not run after I made the correction. This is the new error it brought up. 

Instructor
Posted on:

14 Jul 2023

0

Hey Ferdinand,


You have misspelled 'ylabel' with 'ylebel'. Correct it and you should be good.


Kind regards,

365 Hristina

Posted on:

14 Jul 2023

0

I corrected the spelling and it threw up this error again. What could be the problem again? 

Instructor
Posted on:

17 Jul 2023

0

Hey Ferdinand,


As the error reads, you haven't defined the plot_walk function. The reason is that you haven't executed the cell that defines this function - the upper one. When working in Jupyter notebook, make sure you run the cells in order. That is, run the upper cell first and then run the second one. 


Kind regards,

365 Hristina

Submit an answer