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
464fc8be
authored
May 03, 2023
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
c143b218
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
13 deletions
diy2.py
diy2.py
View file @
464fc8be
# 尝试编写func()函数输出斐波那契数列的第十五个数是什么?
# 斐波那契数列:1,1,2,3,5,8,13,21,34,55……
def
func
(
n
):
print
(
func
(
15
))
#调用函数并打印结果
# def func(n):
# # print(func(15)) #调用函数并打印结果
# a=int(input("输入一个整数"))
# for i in range(1,a):
# if i%7 ==0:
# print(i)
# while True:
# a=int(input("输入一个正整数:"))# 请输入一个正整数
# if a%2==0:
# print(a,"是偶数")
# else:
# print(a,"是奇数")# 判断这个整数是奇数还是偶数?
# a=[3,4,1,9,13]
# b=[i for i in a if i<=5]
# print(b)
# a=[2,5,7,4,9,12,20]
# b=[i for i in a if i%2!=1]
# print(b)# 复制a列表中的偶数元素赋值给一个新列表b
# i=0
# a=int(input("输入一个整数:"))
# while i+7 < a:
# i=i+7
# print(i)
# a=4**3
# print(a)
# a=range(1,8)
# for i in a:
# print(i)
# a=int(input("开始时间小时:"))
# b=int(input("开始时间分钟:"))
# c=int(input("结束时间小时:"))
# d=int(input("结束时间分钟:"))
# a1=a*60+b #开始时间
# c1=c*60+d #结束时间
# f=c1-a1
# e=f//60
# g=f%60
# print(e,"h",g,"m")
def
Plus
(
n1
,
n2
):
return
(
n1
+
n2
)
*
2
print
(
Plus
(
30
,
50
))
\ 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