Commit 0b5a22d1 by BellCodeEditor

auto save

parent 576b5884
Showing with 39 additions and 0 deletions
#导入turtle模块
import turtle
#创建画布
w=turtle.Screen()
#背景颜色为粉色
w.bgcolor('pink')
#创建画笔
pen=turtle.Pen()
#抬起画笔
pen.penup()
#移动初始位置
pen.goto(0,0)
#落笔
pen.pendown()
#画笔的移动速度
pen.speed(1)
#画笔的粗细
pen.width(5)
#画笔的颜色
pen.color('red')
#背景填充色
pen.fillcolor('green')
#开始填充背景
pen.begin_fill()
#画出图形
for i in range(10):
    #画笔移动
    pen.forward(200)
    #画笔回退
    #pen.backward(350)
    #画笔左转
    pen.left(160)
#填充结束
pen.end_fill()
#隐藏画笔
pen.hideturtle()
#画布保持
turtle.done()
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment