Python印花海龟.pos()

2024-04-26 18:04:38 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试编写一个程序,根据用户输入绘制形状。我希望它使用turtle.pos()函数打印形状的每个角点,但是我试图获得打印输出:

"The first corner is at: x, y, with a heading of: d."

目前我使用的印刷品是

^{pr2}$

其输出为:

"The first corner is at: (x, y,), with a heading of: d."

{{cdtuple}将


Tags: ofthe函数用户pos程序iswith
2条回答

弄明白了-不知怎么的我忘了

turtle.xcor()/turtle.ycor()

并能把它们打印成整数。在

print("The first corner is at:", turtle.position()[0], "with a heading of:" 
    turtle.heading() + ".") 

相关问题 更多 >