Not able to understand the error in my code

Hello. I have been trying out to find the error in my code.The code link is https://colab.research.google.com/drive/1t06VK7cS_kj__pA_lRZdSR01RvnoyE9R?usp=sharing.
can you tell me whats wrong in the last section of code?

hey @Sid10 ,
you just to make a small change ,
in the last cell

if not p :

change this line to :

if not os.path.exists( p ):

It will work .
Its actually in the first you were checking that the value of p is None or not and in the updated we are checking whether p path exists or not.

I hope this would resolved your doubt.
Thank You and Happy Learning :slightly_smiling_face:.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.