Commit 47dd2a85 by BellCodeEditor

auto save

parent bfcebd9f
Showing with 20 additions and 3 deletions
打开文件 import turtle #导入海龟画图
写入内容 p = turtle.Pen() #创建画笔
关闭文件 #第一个正方形 右下黑色
p.begin_fill() #开始填充
for i in range(4): #循环画出正方形
p.forward(100) #前进距离(边长)
p.right(90) #转弯角度()
p.end_fill() #结束填充
#画第二个正方形 左上黑色
p.left(180) #调整方向
p.begin_fill() #开始填充
for i in range(4):
p.forward(100) #前进距离(边长)
p.right(90) #转弯角度()
p.end_fill() #结束填充
#第三个正方形 右上白色
#第四个正方形 左下白色
p.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