Turtle Graphics- .home 和 .setpos(0,0) 的区别

Turtle Graphics- difference between .home and .setpos(0,0)

.home 和 .setpos(0,0) 有什么区别?

乌龟之家基本上就是把乌龟设置回坐标(0,0)和setpos(0,0)也是一样的,有什么区别呢?

如果您有任何疑问,请先查看文档。通常大多数答案都可以在这里找到

例如.home()

的文档

turtle.home()

Move turtle to the origin – coordinates (0,0) – and set its heading to its start orientation (which depends on the mode, see mode()).

如果您阅读 docs you can see that setpos() does not change the orientation of the turtle, home() instead resets the orientation according to the current mode