Eulerian Path Algorithm Python If Statements