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
7d3a0e57
authored
Jul 28, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
c256c561
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
2 deletions
diy1.py
diy1.py
View file @
7d3a0e57
# 我们都爱夸夸夸
import
turtle
#导入python中的画画工具包
\ No newline at end of file
import
time
def
LittleHeart
():
for
i
in
range
(
200
):
turtle
.
right
(
1
)
turtle
.
forward
(
2
)
love
=
input
(
'请输入表白语句,然后回车,默认为"I Love You":
\n
'
)
me
=
input
(
'请输入要表白的人:
\n
'
)
if
love
==
''
:
#如果未输入表白语句,则使用默认语句
love
=
'I Love you'
turtle
.
setup
(
width
=
900
,
height
=
600
)
#爱心的画布的大小
turtle
.
color
(
'red'
,
'pink'
)
#爱心的颜色及外边笔的颜色
turtle
.
pensize
(
5
)
#画笔的粗细
turtle
.
speed
(
1000000
)
#绘制速度
turtle
.
up
()
#画笔向上
turtle
.
hideturtle
()
turtle
.
goto
(
0
,
-
180
)
turtle
.
showturtle
()
turtle
.
down
()
turtle
.
speed
(
5
)
turtle
.
begin_fill
()
#开始填充
turtle
.
left
(
140
)
turtle
.
forward
(
224
)
LittleHeart
()
turtle
.
left
(
120
)
LittleHeart
()
turtle
.
forward
(
224
)
turtle
.
end_fill
()
turtle
.
pensize
(
5
)
turtle
.
up
()
turtle
.
hideturtle
()
turtle
.
goto
(
0
,
0
)
turtle
.
showturtle
()
turtle
.
color
(
'#CD5C5C'
,
'pink'
)
turtle
.
write
(
love
,
font
=
(
'gungsuh'
,
30
,),
align
=
"center"
)
turtle
.
up
()
turtle
.
hideturtle
()
if
me
!=
''
:
turtle
.
color
(
'black'
,
'pink'
)
time
.
sleep
(
2
)
turtle
.
goto
(
180
,
-
180
)
turtle
.
showturtle
()
turtle
.
write
(
me
,
font
=
(
20
,),
align
=
"center"
,
move
=
True
)
window
=
turtle
.
Screen
()
window
.
exitonclick
()
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