Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson2-1-1_DIY1
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
0a8fca51
authored
Oct 24, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
1aee9270
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
diy2.py
diy2.py
0 → 100644
View file @
0a8fca51
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
()
#保持画布
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