Dfs Algorithm In Python Using Random