Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson3-2_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
8ad283b4
authored
4 years ago
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
4fb4f4eb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
0 deletions
heart.py
heart.py
0 → 100644
View file @
8ad283b4
import
turtle
#创建画笔
p
=
turtle
.
Pen
()
#画笔颜色
p
.
color
(
"red"
)
#设置笔的粗细
p
.
pensize
(
5
)
#整体填充颜色
p
.
fillcolor
(
"red"
)
#开始填充
p
.
begin_fill
()
#画出圆心:
#先旋转45度
p
.
left
(
45
)
#往前走100步
p
.
forward
(
100
)
#画半圆,逆时针,半圆
p
.
circle
(
50
,
180
)
#画另外一半
#先旋转方向
p
.
right
(
90
)
#先画半圆
p
.
circle
(
50
,
180
)
#直走
p
.
forward
(
100
)
#结束填充
p
.
end_fill
()
#画笔隐藏
p
.
hideturtle
()
#保存画布
turtle
.
done
()
This diff is collapsed.
Click to expand it.
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