Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson3-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
d5ba7fed
authored
4 years ago
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
d5c230f5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
0 deletions
ddiy3.py
ddiy3.py
0 → 100644
View file @
d5ba7fed
#导入模块
import
turtle
#创建画笔
pen
=
turtle
.
Pen
()
#创建屏幕
screen
=
turtle
.
Screen
()
#改变背景颜色
screen
.
bgcolor
(
"pink"
)
#写字
pen
.
write
(
"圣诞节快乐
\n
吃苹果"
,
font
=
(
"Times"
,
25
,
"normal"
))
pen
.
pencolor
(
"red"
)
pen
.
pensize
(
7
)
#转移阵地
pen
.
penup
()
pen
.
goto
(
-
100
,
50
)
pen
.
pendown
()
#用变量优化
lovesize
=
int
(
screen
.
textinput
(
"提示"
,
"爱心大小"
))
#画爱心
pen
.
left
(
45
)
pen
.
forward
(
lovesize
)
pen
.
circle
(
lovesize
/
2
,
180
)
pen
.
right
(
90
)
pen
.
circle
(
lovesize
/
2
,
180
)
pen
.
forward
(
lovesize
)
#隐藏画笔
pen
.
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