Commit 0a8fca51 by BellCodeEditor

save project

parent 1aee9270
Showing with 17 additions and 0 deletions
import turtle #导入绘图模块
ink1=input("请输入线条颜色:")
ink=input("请输入填充颜色:")
pen=turtle.Pen() #创建画笔
pen.color(ink1) #线条颜色
pen.fillcolor(ink)#填充颜色
pen.pensize(3) #画笔粗细
pen.speed(0) #绘画速度 0-10
pen.begin_fill() #开始填充
for i in range(5): #开始循环5次
pen.forward(200) #前进
pen.right(144) #转向
pen.end_fill() #结束填充
turtle.done() #保持画布
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