Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
level3-lesson15-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
d79d8b4e
authored
a year ago
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
c51f46f3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
5 deletions
my_tree.py
yhrjhergb.py
my_tree.py
View file @
d79d8b4e
import
turtle
import
turtle
import
random
pen
=
turtle
.
Turtle
()
pen
=
turtle
.
Pen
()
pen
.
color
(
"sienna"
)
pen
.
color
(
"sienna"
)
pen
.
speed
(
1
)
pen
.
speed
(
1
)
# 画布大小
# 画布大小
...
@@ -21,12 +21,12 @@ def tree(n):
...
@@ -21,12 +21,12 @@ def tree(n):
pen
.
pensize
(
n
/
3
)
pen
.
pensize
(
n
/
3
)
else
:
else
:
pen
.
color
(
"sienna"
)
pen
.
color
(
"sienna"
)
pen
.
pen
pen
size
(
n
/
10
)
pen
.
pensize
(
n
/
10
)
pen
.
for
r
ward
(
n
)
pen
.
forward
(
n
)
angle
=
random
.
random
()
angle
=
random
.
random
()
pen
.
right
(
30
*
angle
)
pen
.
right
(
30
*
angle
)
length
=
1.5
*
random
.
random
()
length
=
1.5
*
random
.
random
()
tree
(
n
-
10
*
leng
ht
)
tree
(
n
-
10
*
leng
th
)
pen
.
left
(
60
*
angle
)
pen
.
left
(
60
*
angle
)
tree
(
n
-
10
*
length
)
tree
(
n
-
10
*
length
)
pen
.
right
(
30
*
angle
)
pen
.
right
(
30
*
angle
)
...
...
This diff is collapsed.
Click to expand it.
yhrjhergb.py
0 → 100644
View file @
d79d8b4e
def
sum_numbers
(
num
):
if
num
==
1
:
return
1
temp
=
sum_numbers
(
num
-
1
)
return
num
+
temp
result
=
sum_numbers
(
100
)
print
(
result
)
\ 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