Last answered:

14 Jul 2023

Posted on:

13 Jul 2023

0

Resolved: This not working what is the reason?

Why is this returning an error please? I have checked the code as much as I could. 

3 answers ( 2 marked as helpful)
Instructor
Posted on:

14 Jul 2023

0

Hey Ferdinand,


Thank you for reaching out.


When working in Jupyter notebook, you should execute the cells in order. You should therefore execute first the cell where the rand_walk function is defined (the first cell in your screenshot). Then, execute the second cell where you use the function.


Kind regards,

365 Hristina

Instructor
Posted on:

14 Jul 2023

1

Hi Ferdinand and Hristina! 
I hope you don't mind if I join the conversation.


Furthermore, I believe your code is missing a colon (:) at the end of the line containing the for statement. 

    for i in range(1, step_num): 
Hope this helps.
Best,
Ivan

Posted on:

14 Jul 2023

0

Thank you all. The real problem was the ":" that was missing. 

Submit an answer