I would just like to raise this code in the online training material.
The return clause of this code includes an extra "p" variable which is not defined anywhere.
Thanks for taking a look.
Thank you for pointing this error in the code. We will fix it in our online course.