Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
level3-lesson13-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
facd978d
authored
Apr 23, 2022
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
92449b0c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
5 deletions
a.py
diy1.py
diy2.py
a.py
0 → 100644
View file @
facd978d
import
time
a
=
time
.
time
()
print
(
a
)
\ No newline at end of file
diy1.py
View file @
facd978d
list1
=
[]
for
a
in
range
(
0
,
1000
):
for
b
in
range
(
0
,
1000
):
list1
.
insert
(
0
,
0
)
\ No newline at end of file
import
turtle
import
random
s
=
turtle
.
Screen
()
s
.
bgcolor
(
'wheat'
)
p
=
turtle
.
Pen
()
p
.
speed
(
0
)
p
.
up
()
p
.
left
(
90
)
p
.
backward
(
100
)
p
.
down
()
def
tree
(
n
):
if
n
>=
0
:
angle
=
random
.
randint
(
15
,
30
)
lenth
=
random
.
randint
(
1
,
15
)
pencolor
=
[
'snow'
,
'lightcoral'
]
tree_lenth
=
n
-
lenth
if
tree_lenth
<
5
:
p
.
color
(
random
.
choice
(
pencolor
))
p
.
pensize
(
3
)
else
:
p
.
pensize
(
n
/
10
)
p
.
color
(
'sienna'
)
p
.
forward
(
n
)
p
.
right
(
angle
)
tree
(
tree_lenth
)
p
.
left
(
2
*
angle
)
tree
(
tree_lenth
)
p
.
right
(
angle
)
p
.
up
()
p
.
backward
(
n
)
p
.
down
()
tree
(
50
)
turtle
.
done
()
diy2.py
0 → 100644
View file @
facd978d
def
sum
(
n
):
if
n
==
1
:
return
1
a
=
n
*
sum
(
n
-
1
)
return
a
print
(
sum
(
4
))
\ 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