This article will tell you about an interesting thing and an interesting thing. I hope it will be helpful to you. Don’t forget to bookmark this site.
Article directory
1. Turtle drawing - colorful four-petal flower
import turtle as t
t.speed(9)
t.pensize(2)
t.penup()
t.goto(0,30)
t.pendown()
t.seth(75)
t.color("black","pink")
t.begin_fill()
for i in range(4):
t.circle(60,270)
t.right(180)
t.end_fill()
t.penup()
t.goto(-35,-20)
t.pendown()
t.color("black","gold")
t.begin_fill()
t.circle(-20)
t.end_fill()
t.done()
2. Turtle drawing - drawing of four-blade wind wheel
import turtle as t
t.pensize(2)
for i in range(4):
t.fd(100)
t.right(90)
t.circle(-100,45)
t.right(90)
t.fd(100)
t.left(135)
t.done()
3. Draw a simple pentagon
import turtle as t
t.penup()
t.goto(0,-50)
t.pendown()
t.pensize(3)
t.color("black","red")
t.begin_fill()
t.circle(100,steps=5)
t.end_fill()
t.done
4. Draw a five-pointed star
import turtle as t
t.penup()
t.goto(-100,50)
t.pendown()
t.colormode(255) #修改颜色模式
t.fillcolor(210,105,30) #修改填充颜色
t.begin_fill()
t.pensize(3)
t.pencolor(178,34,34) #修改画笔颜色
t.pensize(10)
for i in range(5):
t.fd(200)
t.right(144)
t.end_fill()
t.done()
5. Draw arc combination graphics
import turtle as t
t.penup()
t.goto(-100,0)
t.pendown()
for i in range (4):
t.circle(-100,90)
t.right(180)
t.right(90)
t.circle(100)
t.done()
6. Draw a rhombus combination
import turtle as t
t.color("red","gray")
t.pensize(3)
t.begin_fill()
for i in range(3):
t.fd(100)
t.left(60)
t.fd(100)
t.left(120)
t.fd(100)
t.left(60)
t.fd(100)
t.end_fill()
t.done()