Commit c69b666d by BellCodeEditor

save project

parent e8fc335c
# 尝试编写func()函数输出斐波那契数列的第十五个数是什么?
# 斐波那契数列:1,1,2,3,5,8,13,21,34,55……
def func(n):
if n>2:
return 1
elif:
v=func(n-1)+func(n-2)
return v
e=func(20)
print(e)
print(func(15)) #调用函数并打印结果
import wordcloud
from PIL import Image
import numpy as np
with open('python二级考试大纲.txt',encoding='utf-8')as f:
text=f.read()
img=Image.open('bell.png')
data=numpy.arrat(img)
img_kksk=wordcloud.ImageColorGenerator(data)
f=wordcloud.WordCloud(background_color='white'font_path='SimHei.ttf'mask=data,color_func=img_kksk)
f.generate('text')
f.to_file('crazy.png')
f.png

1.51 KB

w.png

1.5 KB

wiii.png

1.49 KB

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