Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson1_1
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
b93e843e
authored
Aug 03, 2020
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
7576f1a2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
97 additions
and
2 deletions
first.py
first.py
View file @
b93e843e
print
(
"hello world"
)
import
turtle
as
t
\ No newline at end of file
def
hair
():
#画头发
t
.
penup
()
t
.
goto
(
-
50
,
150
)
t
.
pendown
()
t
.
fillcolor
(
"gray"
)
t
.
begin_fill
()
for
j
in
range
(
10
):
#重复执行10次
t
.
setheading
(
60
-
(
j
*
36
))
#每次调整初始角度
t
.
circle
(
-
50
,
120
)
#画120度的弧
t
.
end_fill
()
def
face
():
#画脸
t
.
penup
()
t
.
goto
(
0
,
100
)
t
.
pendown
()
t
.
fillcolor
(
"orange"
)
t
.
begin_fill
()
t
.
setheading
(
180
)
t
.
circle
(
85
)
t
.
end_fill
()
#下巴
t
.
circle
(
85
,
120
)
t
.
fillcolor
(
'white'
)
t
.
begin_fill
()
t
.
circle
(
85
,
120
)
t
.
setheading
(
135
)
t
.
circle
(
100
,
95
)
t
.
end_fill
()
def
ears
(
dir
):
#画耳朵,dir用来设置方向,左右耳朵对称
t
.
penup
()
t
.
goto
((
0
-
dir
)
*
30
,
90
)
t
.
setheading
(
90
)
t
.
pendown
()
t
.
fillcolor
(
'orange'
)
t
.
begin_fill
()
t
.
circle
(
dir
*
30
)
t
.
end_fill
()
t
.
penup
()
t
.
goto
((
0
-
dir
)
*
40
,
85
)
t
.
setheading
(
90
)
t
.
pendown
()
t
.
fillcolor
(
'white'
)
t
.
begin_fill
()
t
.
circle
(
dir
*
17
)
t
.
end_fill
()
def
nose
():
#画鼻子
t
.
penup
()
t
.
hideturtle
()
t
.
goto
(
20
,
0
)
t
.
setheading
(
90
)
t
.
pendown
()
t
.
fillcolor
(
'gray'
)
t
.
begin_fill
()
t
.
circle
(
20
)
t
.
end_fill
()
def
eye
(
dir
):
#画眼睛,dir用来设置方向,左右眼对称
t
.
penup
()
t
.
goto
((
0
-
dir
)
*
30
,
20
)
t
.
setheading
(
0
)
t
.
pendown
()
t
.
fillcolor
(
'black'
)
t
.
begin_fill
()
t
.
circle
(
10
)
t
.
end_fill
()
def
mouth
():
#画嘴巴
t
.
penup
()
t
.
goto
(
0
,
0
)
t
.
setheading
(
-
90
)
t
.
pendown
()
t
.
forward
(
50
)
t
.
setheading
(
0
)
t
.
circle
(
80
,
30
)
t
.
penup
()
t
.
goto
(
0
,
-
50
)
t
.
setheading
(
180
)
t
.
pendown
()
t
.
circle
(
-
80
,
30
)
hair
()
face
()
ears
(
1
)
ears
(
-
1
)
eye
(
1
)
eye
(
-
1
)
mouth
()
nose
()
t
.
mainloop
()
\ 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