Commit 4583d136 by BellCodeEditor

save project

parent 0b322af8
Showing with 6 additions and 33 deletions
import turtle
import random
import wordcloud
with open('python二级考试大纲.txt',encoding='utf-8')as f:
text = f.read()
w=wordcloud.WordCloud(background_color="whith",font_path='SimHei.ttf')
w.generate(text)
pen.down()
tree(60)
turtle.done()
pen = turtle.Turtle()
pen.color('sienna')
w = turtle.Screen()
w.bgcolor('wheat')
def tree(n):
if n >= 50:
pen.forward(n)
pen.right(30)
tree(n-10)
pen.right(60)
tree(n-10)
pen.right(30)
pen.up()
pen.backward(n)
pen.down()
pen.left(90)
pen.up()
pen.backward(150)
print(func(15)) #调用函数并打印结果
w.to_file("mycloud.png")
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