Python Turtle Positional Errors <p>I've been trying to scale a Turtle drawing by a single axis and after some testing, I managed the following function:</p> <pre><code>def DrawSquare(length=50.0, Yscale=2): setheading(0) for n in range(0,4): oldYcor = int(ycor()) oldPos = pos() penup() forward(length) newYcor = int(ycor()) print 'OldYcor = ', int(oldYcor) print 'NewYcor = ', int(newYcor) print '------' setpos(oldPos) pendown() if (oldYcor == newYcor): print 'dont scale' forward(length) elif (oldYcor != newYcor): print 'scale' forward(length*Yscale) left(90) penup() speed('slowest') goto(0,0) #TESTS DrawSquare(50.0, 2) DrawSquare(50.0, 2) DrawSquare(50.0, 2) DrawSquare(50.0, 2) </code></pre> <p>The output of these tests should just be four overlapping squares scaled on the y axis, but for some very strange reason Python is randomly changing my Y values before and after a movement by 1 unit, when they should be the same. (for instance, a line being drawn horizontally has an oldYcor of 99, but a newYcor of 100), which completely breaks my code and produces the squares out of place.</p> <p>Another strange thing i noticed is that without converting the turtle's ycor() to an int, the print statements display some bizarre values that dont make any sense to me...</p> <p>I appreciate any help!!</p>