Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
level3-lesson15-diy3
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
0702de63
authored
Nov 16, 2025
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
576b5884
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
0 deletions
gyif.py
my_tree.py
gyif.py
0 → 100644
View file @
0702de63
'''name=input("g")
you=input("p")
hobby=input("d")
print("你好",name,"我喜欢在",you,"做",hobby)
name=input("你的名字是什么")
you=input("你最喜欢的地方是什么")
hobby=input("你的爱好是什么")
print("你好",name,"我喜欢在",you,"做",hobby,"你呢?")
u=input("你好,主任,有什么问题吗?")
print("你提出的",u,"我不会")
u=input("你")
if u=="无"
print("拜拜")'''
color
=
input
(
"请输入五角星的颜色"
)
size
=
int
(
input
(
"请输入五角星的大小(整数):"
))
import
turtle
t
=
turtle
.
Pen
()
t
.
pencolor
(
color
)
t
.
pensize
(
size
)
t
.
fillcolor
(
color
)
t
.
begin_fill
()
for
i
in
range
(
5
):
t
.
forward
(
234
)
t
.
right
(
144
)
t
.
end_fill
()
turtle
.
done
()
my_tree.py
0 → 100644
View file @
0702de63
import
turtle
,
random
pen
=
turtle
.
Pen
()
pen
.
color
(
'sienna'
)
w
=
turtle
.
Screen
()
w
.
bgcolor
(
'wheat'
)
# wheat小麦
# 移动到起点
pen
.
setheading
(
90
)
pen
.
up
()
pen
.
backward
(
150
)
# 后退
pen
.
down
()
pen
.
speed
(
0
)
def
tree
(
n
):
if
n
>=
0
:
if
n
<=
15
:
c
=
random
.
choice
([
"snow"
,
"lightcoral"
])
pen
.
pencolor
(
c
)
pen
.
pensize
(
5
)
else
:
pen
.
color
(
'sienna'
)
pen
.
pensize
(
n
/
10
)
angle
=
random
.
randint
(
1
,
30
)
length
=
random
.
randint
(
1
,
15
)
pen
.
forward
(
n
)
pen
.
right
(
angle
)
tree
(
n
-
length
)
pen
.
left
(
angle
*
2
)
tree
(
n
-
length
)
pen
.
right
(
angle
)
pen
.
penup
()
pen
.
backward
(
n
)
pen
.
pendown
()
tree
(
60
)
turtle
.
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