Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
bellcode
/
lesson13-3
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
8e0e9ebd
authored
Sep 20, 2025
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
9f688882
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
7 deletions
demo0.py
demo1.py
demo2.py
diy.py
demo0.py
0 → 100644
View file @
8e0e9ebd
def
f
(
n
):
if
n
==
1
:
value
=
1
else
:
value
=
n
*
f
(
n
-
1
)
return
value
result
=
f
(
5
)
print
(
result
)
demo1.py
0 → 100644
View file @
8e0e9ebd
import
turtle
def
tree
(
n
):
if
n
>=
50
:
pen
.
forward
(
n
)
pen
.
right
(
30
)
tree
(
n
-
10
)
pen
.
left
(
60
)
tree
(
n
-
10
)
pen
.
right
(
30
)
pen
.
up
()
pen
.
backward
(
n
)
pen
.
down
()
pen
=
turtle
.
Turtle
()
pen
.
color
(
"sienna"
)
#画布大小
w
=
turtle
.
Screen
()
w
.
bgcolor
(
"wheat"
)
turtle
.
done
()
\ No newline at end of file
demo2.py
0 → 100644
View file @
8e0e9ebd
diy.py
View file @
8e0e9ebd
with
open
(
r'C:\Users\user\Desktop.txt.'r'encoding='
utf
-
8
') as file:
def
f
(
n
):
a=file.readlines()
if
n
==
1
:
# print(a)
value
=
1
else
:
value
=
n
*
f
(
n
-
1
)
return
value
for i in a:
result
=
f
(
5
)
data=i.spilt()
print
(
result
)
print(data[1:])
\ 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