How To Implement Dfs Algorithm Python