Dfs Algorithm In Python Using Append