Dfs Algorithm In Python Using A Stack