Objects and Graphics
A graphics library programming task uses a Python turtle object named t in standard mode. Coordinates increase to the right and upward, and one coordinate unit represents one pixel. The turtle starts at (−15,10), facing east.
Its heading is the direction it faces. The commands left() and right() turn it through the given angle in degrees without moving it. The commands forward() and backward() move along or opposite its heading without turning it.
The following commands execute in order:
t.forward(90)
t.left(90)
t.forward(55)
t.backward(20)
t.right(90)
t.forward(15)Find the final x-coordinate and final y-coordinate, each in pixels to zero decimal places.
A Python turtle object named t starts on a blank canvas at (0,0), facing north with its pen down. It uses standard mode, where setheading(0) faces east and setheading(90) faces north. One coordinate unit represents one pixel.
The pen state determines whether movement draws a line. The command penup() disables drawing, and pendown() enables it; neither command moves or turns the turtle. The command goto(x, y) moves directly to the specified coordinates without changing heading. The command setheading() changes heading without moving, and forward() moves in the current heading.
This faulty program draws the unwanted output shown:
t.goto(25, 40)
t.forward(60)Which replacement draws only the horizontal segment from (25,40) to (85,40), with no line connecting the origin to that segment?