Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson10-3
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
47dd2a85
authored
Feb 25, 2023
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
bfcebd9f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
3 deletions
diy1.py
diy1.py
View file @
47dd2a85
打开文件
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment