The turtle python library knowledge and learning (4) of the turtle position (turtle.goto ())

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/weixin_40840880/article/details/102760871

1. absolute coordinates
may be used to allow turtles turtle.goto motion along the absolute coordinate (x, y) The method of
the intermediate screen origin (0,0), form a four-quadrant coordinate system.
Here Insert Picture Description
2. Meaning
turtle.goto (0,300) # x represents 0, up the center 300, y is 300
turtle.goto (-100,100) X represents # -100, 100 representative of left, Y 100, representing up 100
Turtle. goto (100, -100) # x is representative of the right 100, y 100 downward

3. Examples
t.penup ()
T. Goto (0,300) # set the writing position, the position of the word for the location of the center of the screen up 300
t.color ( "Green")
t.write ( "I love you China", font = ( 'Arial', 20, 'normal')) # on the screen and write "I love you China."

Figure:
Here Insert Picture Description
complete.

Guess you like

Origin blog.csdn.net/weixin_40840880/article/details/102760871