Eulerian Path Algorithm Python