Commit 84c0ff11 by BellCodeEditor

auto save

parent fd298e09
Showing with 9 additions and 8 deletions
...@@ -2,14 +2,14 @@ ...@@ -2,14 +2,14 @@
请使用turtle模块画出五角星 请使用turtle模块画出五角星
""" """
import turtle #导入海龟模块 import turtle #导入海龟模块
pen = turtle.Pen() #设置画笔 #设置画笔
turtle.tracer(0) #设置屏幕刷新率 turtle.tracer(0) #设置屏幕刷新率
pen.speed(0) #设置画笔速度 turtle.speed(0) #设置画笔速度
pen.hideturtle() #隐藏画笔 turtle.hideturtle() #隐藏画笔
pen.fillcolor("yellow") #设置填充颜色:黄色 turtle.fillcolor("yellow") #设置填充颜色:黄色
pen.begin_fill() #开始填充 turtle.begin_fill() #开始填充
for i in range(1000): #重复5次 for i in range(1000): #重复5次
pen.forward(i) #移动100步 turtle.forward(i) #移动100步
pen.right(109) #右转144度 turtle.right(109) #右转144度
pen.end_fill() #结束填充 turtle.end_fill() #结束填充
turtle.done() #保留绘画界面 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