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
afc6927f
authored
Jan 31, 2026
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
136b2d74
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
23 deletions
diy2.py
feoiuv89fgco.py
diy2.py
View file @
afc6927f
# 尝试编写func()函数输出斐波那契数列的第十五个数是什么?
name
=
'刘强'
# 斐波那契数列:1,1,2,3,5,8,13,21,34,55……
power
=
66
def
func
(
n
):
hero
=
[
'赵一'
,
30
,
'丁二'
,
37
,
'孙五'
,
52
,
'王猛'
,
89
,
'周亮'
,
98
]
for
i
in
range
(
len
(
hero
)):
if
i
%
2
==
1
and
hero
[
i
]
>=
power
:
hero
.
insert
(
i
-
1
,
name
)
hero
.
insert
(
i
,
power
)
print
((
hero
))
\ No newline at end of file
print
(
func
(
15
))
#调用函数并打印结果
feoiuv89fgco.py
View file @
afc6927f
input
(
"姓名:"
)
as1
=
input
(
"姓名:"
)
a
=
input
()
as2
=
input
(
"爱好:"
)
print
(
"a"
)
as3
=
input
(
"未来的目标:"
)
input
(
"爱好:"
)
input
(
"未来的目标:"
)
print
(
"姓名:"
)
print
(
"姓名:"
)
print
(
"小酷编程"
)
print
(
as1
)
print
(
"爱好:"
)
print
(
"爱好:"
)
print
(
"写代码"
)
print
(
as2
)
print
(
"未来的目标:"
)
print
(
"未来的目标:"
)
print
(
"成为顶尖程序员"
)
print
(
as3
)
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