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
8fb8fb98
authored
Feb 15, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
c2f1308f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
2 deletions
diy1.py
diy1.py
View file @
8fb8fb98
# 利用write()帮助悟空给诺依回信吧~
# 利用write()帮助悟空给诺依回信吧~
\ No newline at end of file
import
turtle
#载入turtle画图工具包
pen
=
turtle
.
Pen
()
#调用Pen()方法创建新的画笔,并赋值给变量pen
#抬笔
pen
.
penup
()
#将写字初始点移到(100,-100)的地方
pen
.
goto
(
100
,
-
100
)
pen
.
write
(
"你们这些傻子,
\n
叫你们做笔记不做笔记,
\n
还好意思打代码"
,
font
=
(
"Times"
,
20
,
"bold"
))
pen
.
hideturtle
()
#调用hideturtle()方法隐藏画笔标识
#画爱心
sc
=
turtle
.
Screen
()
#创建幕布,并赋值给变量sc
#改变背景颜色淡蓝色
sc
.
bgcolor
(
"light blue"
)
pen1
=
turtle
.
Pen
()
pen1
.
pensize
(
5
)
#设置画笔的大小
pen1
.
pencolor
(
"red"
)
#设置画笔的颜色
#画爱心的下边
pen1
.
left
(
45
)
pen1
.
forward
(
100
)
#画第一个半圆
pen1
.
circle
(
50
,
180
)
#画第二个半圆
pen1
.
right
(
90
)
pen1
.
circle
(
50
,
180
)
#画爱心的另一个下边
pen1
.
forward
(
100
)
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