In Python, istead of if len(path) > 0, you can just use „if path:”