2024-03-28 10:20:23 发布
网友
我已经开始了,但不知道如何继续。我是初学者,所以尽量使用简单的术语。我想用turtle库写“诺亚”
turtle
到目前为止,我的代码是:
import turtle t=turtle.Turtle() t.penup t.speed(3) t.color("blue") t.penup t.begin_fill() t.goto(1,1) t.right(280) t.forward(90)
以您的代码为基础,这里有一个“N”:
import turtle t=turtle.Turtle() t.penup t.speed(3) t.color("blue") t.penup t.begin_fill() t.goto(1,1) t.right(270) t.forward(90) t.right(160) t.forward(95) t.left(160) t.forward(90) t.penup() t.goto(80,80) t.pendown() turtle.done()
我在末尾添加了turtle.done(),因此窗口不会立即关闭
turtle.done()
t.penup表示你正在“把笔从纸上拿下来”,而pendown()则表示相反的意思
t.penup
pendown()
以您的代码为基础,这里有一个“N”:
我在末尾添加了
turtle.done()
,因此窗口不会立即关闭t.penup
表示你正在“把笔从纸上拿下来”,而pendown()
则表示相反的意思相关问题 更多 >
编程相关推荐