Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
level3-lesson15-diy3
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
0b5a22d1
authored
Aug 14, 2024
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
576b5884
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
0 deletions
1.py
1.py
0 → 100644
View file @
0b5a22d1
#导入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
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