python的turtle可以定义多个海龟对象
import turtle as t
t.color('purple')
t.right(10)
t.fd(100)
t1 = t.Turtle()
#t1.color('red')
t1.left(10)
t1.fd(100)
t2 = t.Turtle()
#t2.color('green')
t2.left(20)
t2.fd(100)
t3 = t.Turtle()
#t3.color('blue')
t3.left(30)
t3.fd(100)
python的turtle可以定义多个海龟对象,但是只能有一块画布。
可以用turtle.Screen()或者直接用turtle.setup()定义。