Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
level3-lesson14-diy2
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
a2aee556
authored
Aug 04, 2024
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
9f3acf8a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
131 additions
and
15 deletions
123456789.py
ag.py
aga
diy2.py
hygy.py
123456789.py
0 → 100644
View file @
a2aee556
import
turtle
turtle
.
speed
(
5
)
turtle
.
penup
()
turtle
.
goto
(
95
,
150
)
turtle
.
pendown
()
turtle
.
begin_fill
()
turtle
.
color
(
"red"
,
"red"
)
for
i
in
range
(
2
):
turtle
.
forward
(
60
)
turtle
.
right
(
90
)
turtle
.
forward
(
400
)
turtle
.
right
(
90
)
turtle
.
end_fill
()
turtle
.
penup
()
turtle
.
goto
(
100
,
-
250
)
turtle
.
color
(
"black"
)
turtle
.
pendown
()
turtle
.
write
(
"一
\n
帆
\n
风
\n
顺
\n
年
\n
年
\n
好"
,
font
=
(
"华文行楷"
,
40
))
turtle
.
penup
()
turtle
.
goto
(
-
155
,
150
)
turtle
.
pendown
()
turtle
.
begin_fill
()
turtle
.
color
(
"red"
,
"red"
)
for
i
in
range
(
2
):
turtle
.
forward
(
60
)
turtle
.
right
(
90
)
turtle
.
forward
(
400
)
turtle
.
right
(
90
)
turtle
.
end_fill
()
turtle
.
penup
()
turtle
.
goto
(
-
150
,
-
250
)
turtle
.
color
(
"black"
)
turtle
.
pendown
()
turtle
.
write
(
"万
\n
事
\n
如
\n
意
\n
步
\n
步
\n
高"
,
font
=
(
"华文行楷"
,
40
))
turtle
.
penup
()
turtle
.
goto
(
-
100
,
220
)
turtle
.
pendown
()
turtle
.
begin_fill
()
turtle
.
color
(
"red"
,
"red"
)
for
i
in
range
(
2
):
turtle
.
forward
(
210
)
turtle
.
left
(
90
)
turtle
.
forward
(
60
)
turtle
.
left
(
90
)
turtle
.
end_fill
()
turtle
.
color
(
"black"
)
turtle
.
write
(
"五福临门"
,
font
=
(
"华文行楷"
,
40
))
turtle
.
hideturtle
()
turtle
.
done
()
ag.py
0 → 100644
View file @
a2aee556
import
turtle
import
random
t
=
turtle
.
Turtle
t
.
penup
()
t
.
goto
(
-
10
,
0
)
td
=
"你好,我是 "
for
char
in
td
:
font_size
=
random
.
randint
(
10
,
30
)
t
.
pendown
()
t
.
write
(
char
,
font
=
(
"Arial"
,
font_size
,
"normal"
))
jump_distance
=
random
.
randint
(
20
,
40
)
t
.
penup
t
.
forward
(
jump_distance
)
t
.
hideturtle
()
turtle
.
done
()
\ No newline at end of file
aga
0 → 100644
View file @
a2aee556
diy2.py
View file @
a2aee556
# 尝试编写func()函数输出斐波那契数列的第十五个数是什么?
# 斐波那契数列:1,1,2,3,5,8,13,21,34,55……
def
func
(
n
):
if
n
<=
2
:
return
1
elif
n
>
2
:
Value
=
func
(
n
-
1
)
+
func
(
n
-
2
)
return
Value
import
turtle
import
random
t
=
turtle
.
Turtle
()
t
.
penup
()
t
.
goto
(
-
10
,
0
)
text
=
"你好,我的名字是"
for
char
in
text
:
font_size
=
random
.
randint
(
10
,
30
)
t
.
pendown
()
t
.
write
(
char
,
font
=
(
"Arial"
,
font_size
,
"normal"
))
jump_distance
=
random
.
randint
(
20
,
50
)
t
.
penup
()
t
.
forward
(
jump_distance
)
print
(
func
(
15
))
#调用函数并打印结果
t
.
hideturtle
()
turtle
.
done
()
hygy.py
0 → 100644
View file @
a2aee556
import
turtle
as
t
t
.
pensize
(
5
)
t
.
pencolor
(
"orange"
)
t
.
fillcolor
(
"yellow"
)
t
.
begin_fill
()
t
.
penup
()
t
.
goto
(
0
,
-
200
)
t
.
pendown
()
t
.
circle
(
200
)
t
.
end_fill
()
t
.
pensize
(
3
)
t
.
penup
()
t
.
goto
(
80
,
65
)
t
.
pendown
()
t
.
pencolor
(
"brown"
)
t
.
fillcolor
(
"white"
)
t
.
circle
(
35
)
t
.
end_fill
()
t
.
pencolor
(
"black"
)
t
.
fillcolor
(
"black"
)
t
.
begin_fill
()
t
.
circle
(
23
)
t
.
end_fill
()
t
.
pensize
(
3
)
t
.
penup
()
t
.
goto
(
-
80
,
65
)
t
.
pendown
()
t
.
pencolor
(
"brown"
)
t
.
fillcolor
(
"white"
)
t
.
circle
(
35
)
t
.
end_fill
()
t
.
pencolor
(
"black"
)
t
.
fillcolor
(
"black"
)
t
.
begin_fill
()
t
.
circle
(
23
)
t
.
end_fill
()
t
.
pencolor
(
"brown"
)
t
.
penup
()
t
.
goto
(
0
,
-
90
)
t
.
pendown
()
t
.
circle
(
-
120
,
60
)
t
.
left
(
180
)
t
.
circle
(
120
,
120
)
t
.
seth
()
t
.
hideturtle
()
t
.
done
()
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