Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson3-3_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
e8c2a2f6
authored
a year ago
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
654bc3ba
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
0 deletions
diy.py
diy.py
0 → 100644
View file @
e8c2a2f6
import
turtle
pen
=
turtle
.
Pen
()
fontpen
=
turtle
.
Pen
()
fontpen
.
write
(
"hello:诺依
\n
见到你的信很开心"
,
font
=
(
"Times"
,
20
,
"normal"
))
fontpen
.
hideturtle
()
fontpen
.
up
()
screen
=
turtle
.
Screen
()
fontpen
.
goto
(
100
,
-
220
)
#背景颜色
screen
=
turtle
.
Screen
()
screen
.
bgcolor
(
"light blue"
)
pen
.
up
()
pen
.
hideturtle
()
#定义变量
#len = 50
len
=
screen
.
textinput
(
"桃心大小"
,
"你想要多大的爱心"
)
length
=
int
(
len
)
pen
.
goto
(
100
,
180
)
pen
.
down
()
pen
.
pensize
(
5
)
pen
.
pencolor
(
"red"
)
pen
.
left
(
45
)
pen
.
circle
(
length
,
180
)
pen
.
right
(
90
)
pen
.
circle
(
length
,
180
)
pen
.
forward
(
2
*
length
)
pen
.
left
(
90
)
pen
.
forward
(
2
*
length
)
turtle
.
done
()
\ No newline at end of file
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