Commit a2aee556 by BellCodeEditor

auto save

parent 9f3acf8a
Showing with 131 additions and 15 deletions
import turtle
turtle.speed(5)
turtle.penup()
turtle.goto(95,150)
turtle.pendown()
turtle.begin_fill()
turtle.color("red","red")
for i in range(2):
turtle.forward(60)
turtle.right(90)
turtle.forward(400)
turtle.right(90)
turtle.end_fill()
turtle.penup()
turtle.goto(100,-250)
turtle.color("black")
turtle.pendown()
turtle.write("一\n\n\n\n\n\n好",font=("华文行楷",40))
turtle.penup()
turtle.goto(-155,150)
turtle.pendown()
turtle.begin_fill()
turtle.color("red","red")
for i in range(2):
turtle.forward(60)
turtle.right(90)
turtle.forward(400)
turtle.right(90)
turtle.end_fill()
turtle.penup()
turtle.goto(-150,-250)
turtle.color("black")
turtle.pendown()
turtle.write("万\n\n\n\n\n\n高",font=("华文行楷",40))
turtle.penup()
turtle.goto(-100,220)
turtle.pendown()
turtle.begin_fill()
turtle.color("red","red")
for i in range(2):
turtle.forward(210)
turtle.left(90)
turtle.forward(60)
turtle.left(90)
turtle.end_fill()
turtle.color("black")
turtle.write("五福临门",font=("华文行楷",40))
turtle.hideturtle()
turtle.done()
import turtle
import random
t=turtle.Turtle
t.penup()
t.goto(-10,0)
td="你好,我是 "
for char in td:
font_size=random.randint(10,30)
t.pendown()
t.write(char,font=("Arial",font_size,"normal"))
jump_distance = random.randint(20,40)
t.penup
t.forward(jump_distance)
t.hideturtle()
turtle.done()
\ No newline at end of file
# 尝试编写func()函数输出斐波那契数列的第十五个数是什么?
# 斐波那契数列:1,1,2,3,5,8,13,21,34,55……
def func(n):
if n<=2:
return 1
elif n>2:
Value=func(n-1)+func(n-2)
return Value
import turtle
import random
t=turtle.Turtle()
t.penup()
t.goto(-10,0)
text="你好,我的名字是"
for char in text:
font_size = random.randint(10,30)
t.pendown()
t.write(char,font=("Arial",font_size,"normal"))
jump_distance = random.randint(20,50)
t.penup()
t.forward(jump_distance)
print(func(15)) #调用函数并打印结果
t.hideturtle()
turtle.done()
import turtle as t
t.pensize(5)
t.pencolor("orange")
t.fillcolor("yellow")
t.begin_fill()
t.penup()
t.goto(0,-200)
t.pendown()
t.circle(200)
t.end_fill()
t.pensize(3)
t.penup()
t.goto(80,65)
t.pendown()
t.pencolor("brown")
t.fillcolor("white")
t.circle(35)
t.end_fill()
t.pencolor("black")
t.fillcolor("black")
t.begin_fill()
t.circle(23)
t.end_fill()
t.pensize(3)
t.penup()
t.goto(-80,65)
t.pendown()
t.pencolor("brown")
t.fillcolor("white")
t.circle(35)
t.end_fill()
t.pencolor("black")
t.fillcolor("black")
t.begin_fill()
t.circle(23)
t.end_fill()
t.pencolor("brown")
t.penup()
t.goto(0,-90)
t.pendown()
t.circle(-120,60)
t.left(180)
t.circle(120,120)
t.seth()
t.hideturtle()
t.done()
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