Commit 027c8129 by BellCodeEditor

auto save

parent 1daf8d4d
Showing with 4 additions and 3 deletions
import jieba
text= "你站在桥上看风景,看风景⼈在楼上看你。明⽉装饰了你的窗⼦,你装饰了别⼈的梦"
\ No newline at end of file
# 尝试编写func()函数输出斐波那契数列的第十五个数是什么?
# 斐波那契数列:1,1,2,3,5,8,13,21,34,55……
def func(n): def func(n):
if n<=2: if n<=2:
return 1 return 1
...@@ -7,5 +5,5 @@ def func(n): ...@@ -7,5 +5,5 @@ def func(n):
num=func(n-1)+func(n-2) num=func(n-1)+func(n-2)
return num return num
result=func(15) result=func(15)
print(result) #调用函数并打印结果 print(result)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment